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.
65 66 67 |
# File 'lib/sblogistica.rb', line 65 def initialize(setting) @setting = setting end |
Class Method Details
.build(setting, type) ⇒ Object
55 56 57 |
# File 'lib/sblogistica.rb', line 55 def self.build(setting, type) (type ? klass(type) : self).new(setting) end |
.klass(type) ⇒ Object
59 60 61 62 63 |
# File 'lib/sblogistica.rb', line 59 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
69 70 71 |
# File 'lib/sblogistica.rb', line 69 def value(*_args) @setting end |