Class: RubyApp::Elements::Mobile::List::ClickedEvent

Inherits:
RubyApp::Element::Event show all
Defined in:
lib/ruby_app/elements/mobile/list.rb

Direct Known Subclasses

ItemClickedEvent, LinkClickedEvent

Instance Attribute Summary collapse

Attributes inherited from RubyApp::Element::Event

#now, #session, #source

Instance Method Summary collapse

Methods inherited from RubyApp::Element::Event

#add_class, #alert, #assert, #assert_exists_input, #assert_exists_link, #assert_exists_search, #assert_exists_selector, #assert_exists_selector_for, #assert_exists_selector_value, #assert_exists_selector_value_for, #assert_exists_text, #assert_is_selector_visible, #assert_is_text_visible, #assert_not_exists_input, #assert_not_exists_link, #assert_not_exists_search, #assert_not_exists_selector, #assert_not_exists_selector_for, #assert_not_exists_selector_value, #assert_not_exists_selector_value_for, #assert_not_exists_text, #assert_not_is_selector_visible, #assert_not_is_text_visible, #click_link, #click_list_item, #click_list_link, #click_selector, #confirm_refresh_browser, #create_trigger, #delay, #destroy_trigger, #execute, from_hash, #go, #log, #process!, #quit!, #refresh_browser, #remove_class, #remove_page, #send_message, #set_cookie, #show_page, #swipe, #today, #trigger_element, #update_document_text, #update_element, #update_element?, #update_input, #update_search, #update_style, #update_text, #update_value, #update_value_for

Methods included from Mixins::TranslateMixin

#localize, #translate

Constructor Details

#initialize(data) ⇒ ClickedEvent

Returns a new instance of ClickedEvent.



60
61
62
63
64
65
66
67
# File 'lib/ruby_app/elements/mobile/list.rb', line 60

def initialize(data)
  super(data)

  item = RubyApp::Element.get_element(data['item'])
  raise RubyApp::Exceptions::ElementInvalidException.new(data['item']) unless item
  @item = item

end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



58
59
60
# File 'lib/ruby_app/elements/mobile/list.rb', line 58

def item
  @item
end

Instance Method Details

#to_hashObject



69
70
71
# File 'lib/ruby_app/elements/mobile/list.rb', line 69

def to_hash
  super.merge('item' => @item.element_id)
end