Class: Ugigi::Scheme
- Inherits:
-
Object
- Object
- Ugigi::Scheme
- Defined in:
- lib/ugigi/scheme.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
Instance Method Summary collapse
-
#initialize(element) ⇒ Scheme
constructor
A new instance of Scheme.
- #method_missing(action, *args) ⇒ Object
- #params ⇒ Object (also: #available_methods)
Constructor Details
#initialize(element) ⇒ Scheme
Returns a new instance of Scheme.
5 6 7 |
# File 'lib/ugigi/scheme.rb', line 5 def initialize(element) @element = element end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(action, *args) ⇒ Object
9 10 11 |
# File 'lib/ugigi/scheme.rb', line 9 def method_missing(action, *args) return @element[action.to_s] rescue nil end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
3 4 5 |
# File 'lib/ugigi/scheme.rb', line 3 def element @element end |
Instance Method Details
#params ⇒ Object Also known as: available_methods
13 |
# File 'lib/ugigi/scheme.rb', line 13 def params() @element.keys.map{|k|k.to_sym} ; end |