Class: RubyApp::Elements::List::ClickedEvent
- Inherits:
-
RubyApp::Element::Event
- Object
- RubyApp::Element::Event
- RubyApp::Elements::List::ClickedEvent
- Defined in:
- lib/ruby_app/elements/list.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Attributes inherited from RubyApp::Element::Event
Instance Method Summary collapse
-
#initialize(data) ⇒ ClickedEvent
constructor
A new instance of ClickedEvent.
- #to_hash ⇒ Object
Methods inherited from RubyApp::Element::Event
#add_class, #alert, #confirm_refresh, #execute, from_hash, #go, #hide, #process!, #refresh, #remove_class, #set_cookie, #show, #today, #update_element, #update_text, #update_value
Methods included from Mixins::TranslateMixin
Constructor Details
#initialize(data) ⇒ ClickedEvent
Returns a new instance of ClickedEvent.
17 18 19 20 21 |
# File 'lib/ruby_app/elements/list.rb', line 17 def initialize(data) super(data) @index = data['index'].to_i @item = self.source.items[@index] end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
15 16 17 |
# File 'lib/ruby_app/elements/list.rb', line 15 def index @index end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
15 16 17 |
# File 'lib/ruby_app/elements/list.rb', line 15 def item @item end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 |
# File 'lib/ruby_app/elements/list.rb', line 23 def to_hash super.merge('index' => @index) end |