Class: UnderOs::Events::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/under_os/events.rb

Direct Known Subclasses

UI::Events::Event

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



69
70
71
# File 'lib/under_os/events.rb', line 69

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



69
70
71
# File 'lib/under_os/events.rb', line 69

def params
  @params
end