Class: GDK::ConfigType::Builder
- Inherits:
-
Object
- Object
- GDK::ConfigType::Builder
- Defined in:
- lib/gdk/config_type/builder.rb
Instance Attribute Summary collapse
-
#blk ⇒ Object
readonly
Returns the value of attribute blk.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
- #build(parent:) ⇒ Object
- #ignore? ⇒ Boolean
-
#initialize(key:, klass:, **kwargs, &blk) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(key:, klass:, **kwargs, &blk) ⇒ Builder
Returns a new instance of Builder.
8 9 10 11 12 13 |
# File 'lib/gdk/config_type/builder.rb', line 8 def initialize(key:, klass:, **kwargs, &blk) @key = key @klass = klass @kwargs = kwargs @blk = blk end |
Instance Attribute Details
#blk ⇒ Object (readonly)
Returns the value of attribute blk.
6 7 8 |
# File 'lib/gdk/config_type/builder.rb', line 6 def blk @blk end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/gdk/config_type/builder.rb', line 6 def key @key end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
6 7 8 |
# File 'lib/gdk/config_type/builder.rb', line 6 def klass @klass end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
6 7 8 |
# File 'lib/gdk/config_type/builder.rb', line 6 def kwargs @kwargs end |
Instance Method Details
#build(parent:) ⇒ Object
19 20 21 |
# File 'lib/gdk/config_type/builder.rb', line 19 def build(parent:) klass.new(parent: parent, builder: self, **kwargs) end |
#ignore? ⇒ Boolean
15 16 17 |
# File 'lib/gdk/config_type/builder.rb', line 15 def ignore? key.start_with?('__') || key.end_with?('?') end |