Class: BitzerStore::Configure
- Inherits:
-
Object
- Object
- BitzerStore::Configure
- Defined in:
- lib/bitzer_store/configure.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
Instance Method Summary collapse
- #common_setting(*args) ⇒ Object
-
#initialize ⇒ Configure
constructor
A new instance of Configure.
- #method_missing(name, *args, &block) ⇒ Object
- #set(name, *args) ⇒ Object
Constructor Details
#initialize ⇒ Configure
Returns a new instance of Configure.
15 16 17 |
# File 'lib/bitzer_store/configure.rb', line 15 def initialize @settings = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
27 28 29 |
# File 'lib/bitzer_store/configure.rb', line 27 def method_missing(name, *args, &block) set(name, *args) end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
13 14 15 |
# File 'lib/bitzer_store/configure.rb', line 13 def settings @settings end |
Class Method Details
Instance Method Details
#common_setting(*args) ⇒ Object
31 32 33 34 |
# File 'lib/bitzer_store/configure.rb', line 31 def common_setting(*args) @common_options = args. @common_args = args end |
#set(name, *args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/bitzer_store/configure.rb', line 19 def set(name, *args) = .merge(args.) args = args.presence || common_args args = args + [] if .present? @settings[name] = args end |