Class: Ugigi::Scheme

Inherits:
Object
  • Object
show all
Defined in:
lib/ugigi/scheme.rb

Direct Known Subclasses

Index

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#elementObject

Returns the value of attribute element.



3
4
5
# File 'lib/ugigi/scheme.rb', line 3

def element
  @element
end

Instance Method Details

#paramsObject Also known as: available_methods



13
# File 'lib/ugigi/scheme.rb', line 13

def params() @element.keys.map{|k|k.to_sym} ; end