Class: RubyApp::Elements::Calendars::Base::BaseMonth::MovedEvent
- Inherits:
-
RubyApp::Element::Event
- Object
- RubyApp::Element::Event
- RubyApp::Elements::Calendars::Base::BaseMonth::MovedEvent
- Defined in:
- lib/ruby_app/elements/calendars/base/base_month.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Attributes inherited from RubyApp::Element::Event
Instance Method Summary collapse
-
#initialize(data) ⇒ MovedEvent
constructor
A new instance of MovedEvent.
- #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) ⇒ MovedEvent
Returns a new instance of MovedEvent.
21 22 23 24 25 |
# File 'lib/ruby_app/elements/calendars/base/base_month.rb', line 21 def initialize(data) super(data) @unit = data['unit'].to_sym @amount = data['amount'].to_i end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
19 20 21 |
# File 'lib/ruby_app/elements/calendars/base/base_month.rb', line 19 def amount @amount end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
19 20 21 |
# File 'lib/ruby_app/elements/calendars/base/base_month.rb', line 19 def unit @unit end |
Instance Method Details
#to_hash ⇒ Object
27 28 29 |
# File 'lib/ruby_app/elements/calendars/base/base_month.rb', line 27 def to_hash super.merge('unit' => @name, 'amount' => @amount) end |