Class: Configurable
- Inherits:
-
Object
- Object
- Configurable
- Defined in:
- lib/servicy/configurable.rb
Instance Method Summary collapse
-
#initialize ⇒ Configurable
constructor
A new instance of Configurable.
- #method_missing(name, *args, &block) ⇒ Object
- #nil? ⇒ Boolean
Constructor Details
#initialize ⇒ Configurable
Returns a new instance of Configurable.
2 3 4 |
# File 'lib/servicy/configurable.rb', line 2 def initialize @stuff = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/servicy/configurable.rb', line 6 def method_missing(name, *args, &block) if name.to_s =~ /=$/ @stuff[name.to_s.sub(/=$/, '')] = args.first return end return @stuff[name] if @stuff[name] @stuff[name] = Configurable.new end |
Instance Method Details
#nil? ⇒ Boolean
16 17 18 |
# File 'lib/servicy/configurable.rb', line 16 def nil? true end |