Class: RubyApp::Elements::Calendars::Base::BaseMonth::MovedEvent

Inherits:
RubyApp::Element::Event show all
Defined in:
lib/ruby_app/elements/calendars/base/base_month.rb

Instance Attribute Summary collapse

Attributes inherited from RubyApp::Element::Event

#now, #source

Instance Method Summary collapse

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

#localize, #translate

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

#amountObject (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

#unitObject (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_hashObject



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