Class: Sblogistica::DynamicSetting
- Inherits:
-
Object
- Object
- Sblogistica::DynamicSetting
- Defined in:
- lib/sblogistica.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(setting) ⇒ DynamicSetting
constructor
A new instance of DynamicSetting.
- #value(*_args) ⇒ Object
Constructor Details
#initialize(setting) ⇒ DynamicSetting
Returns a new instance of DynamicSetting.
69 70 71 |
# File 'lib/sblogistica.rb', line 69 def initialize(setting) @setting = setting end |
Class Method Details
.build(setting, type) ⇒ Object
59 60 61 |
# File 'lib/sblogistica.rb', line 59 def self.build(setting, type) (type ? klass(type) : self).new(setting) end |
.klass(type) ⇒ Object
63 64 65 66 67 |
# File 'lib/sblogistica.rb', line 63 def self.klass(type) klass = "#{type.to_s.camelcase}Setting" raise ArgumentError, "Unknown type: #{type}" unless Sblogistica.const_defined?(klass) Sblogistica.const_get(klass) end |
Instance Method Details
#value(*_args) ⇒ Object
73 74 75 |
# File 'lib/sblogistica.rb', line 73 def value(*_args) @setting end |