Class: CaptainConfig::ConfiguredEntry
- Inherits:
-
Object
- Object
- CaptainConfig::ConfiguredEntry
- Defined in:
- lib/captain_config/configured_entry.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#model ⇒ Object
readonly
Class of the model (eg. ‘CaptainConfig::BooleanConfig`).
Instance Method Summary collapse
- #default_value ⇒ Object
-
#initialize(key, model) ⇒ ConfiguredEntry
constructor
A new instance of ConfiguredEntry.
Constructor Details
#initialize(key, model) ⇒ ConfiguredEntry
Returns a new instance of ConfiguredEntry.
7 8 9 10 11 |
# File 'lib/captain_config/configured_entry.rb', line 7 def initialize(key, model) @key = key @model = model @default = nil end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
5 6 7 |
# File 'lib/captain_config/configured_entry.rb', line 5 def default @default end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
2 3 4 |
# File 'lib/captain_config/configured_entry.rb', line 2 def key @key end |
#model ⇒ Object (readonly)
Class of the model (eg. ‘CaptainConfig::BooleanConfig`).
4 5 6 |
# File 'lib/captain_config/configured_entry.rb', line 4 def model @model end |
Instance Method Details
#default_value ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/captain_config/configured_entry.rb', line 13 def default_value if default.respond_to?(:call) default.call else default end end |