Class: UnderOs::Events::Event
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(name, params) ⇒ Event
constructor
A new instance of Event.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(name, params) ⇒ Event
Returns a new instance of Event.
71 72 73 74 |
# File 'lib/under_os/events.rb', line 71 def initialize(name, params) @name = name.to_sym @params = params end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/under_os/events.rb', line 76 def method_missing(name, *args, &block) if @params.has_key?(name.to_sym) @params[name.to_sym] else super name, *args, &block end end |