Class: GDK::ConfigType::Base
- Inherits:
-
Object
- Object
- GDK::ConfigType::Base
show all
- Extended by:
- Forwardable
- Defined in:
- lib/gdk/config_type/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(parent:, builder:) ⇒ Base
Returns a new instance of Base.
12
13
14
15
16
17
|
# File 'lib/gdk/config_type/base.rb', line 12
def initialize(parent:, builder:)
@parent = parent
@builder = builder
self.value = read_value
end
|
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder.
8
9
10
|
# File 'lib/gdk/config_type/base.rb', line 8
def builder
@builder
end
|
#parent ⇒ Object
Returns the value of attribute parent.
8
9
10
|
# File 'lib/gdk/config_type/base.rb', line 8
def parent
@parent
end
|
#user_value ⇒ Object
Returns the value of attribute user_value.
8
9
10
|
# File 'lib/gdk/config_type/base.rb', line 8
def user_value
@user_value
end
|
#value ⇒ Object
Returns the value of attribute value.
8
9
10
|
# File 'lib/gdk/config_type/base.rb', line 8
def value
@value
end
|
Instance Method Details
#dump! ⇒ Object
43
44
45
|
# File 'lib/gdk/config_type/base.rb', line 43
def dump!(*)
value
end
|
#root ⇒ Object
Also known as:
config
51
52
53
|
# File 'lib/gdk/config_type/base.rb', line 51
def root
parent&.root || self
end
|
#slug ⇒ Object
47
48
49
|
# File 'lib/gdk/config_type/base.rb', line 47
def slug
[parent.slug, key].compact.join('.')
end
|
#user_defined? ⇒ Boolean
35
36
37
|
# File 'lib/gdk/config_type/base.rb', line 35
def user_defined?
!!defined?(@user_value)
end
|
#validate! ⇒ Object
39
40
41
|
# File 'lib/gdk/config_type/base.rb', line 39
def validate!
true end
|