Class: RubyApp::Elements::Mobile::Calendars::Month

Inherits:
RubyApp::Element show all
Defined in:
lib/ruby_app/elements/mobile/calendars/month.rb

Defined Under Namespace

Classes: ChangedEvent

Instance Attribute Summary collapse

Attributes inherited from RubyApp::Element

#attributes

Instance Method Summary collapse

Methods inherited from RubyApp::Element

#element_id, get_element

Methods included from Mixins::ConfigurationMixin

#configuration

Methods included from Mixins::TranslateMixin

#localize, #translate

Methods included from Mixins::TemplateMixin

#exclude_parent_template, #exclude_parent_template?, #get_cache, #get_default_template, #get_template, #get_template_name, #get_templates, #template_path

Methods included from Mixins::RenderMixin

#content_for, #get_cache, #get_default_template, #get_templates, #render

Constructor Details

#initialize(today = Date.today, value = Date.today) ⇒ Month

Returns a new instance of Month.



40
41
42
43
44
45
# File 'lib/ruby_app/elements/mobile/calendars/month.rb', line 40

def initialize(today = Date.today, value = Date.today)
  super()
  @today = today
  @value = value
  @display = @value
end

Instance Attribute Details

#displayObject

Returns the value of attribute display.



36
37
38
# File 'lib/ruby_app/elements/mobile/calendars/month.rb', line 36

def display
  @display
end

#valueObject

Returns the value of attribute value.



35
36
37
# File 'lib/ruby_app/elements/mobile/calendars/month.rb', line 35

def value
  @value
end

Instance Method Details

#move_next!(event) ⇒ Object



52
53
54
55
# File 'lib/ruby_app/elements/mobile/calendars/month.rb', line 52

def move_next!(event)
  @display = @display >> 1
  event.update_element(self)
end

#move_previous!(event) ⇒ Object



47
48
49
50
# File 'lib/ruby_app/elements/mobile/calendars/month.rb', line 47

def move_previous!(event)
  @display = @display << 1
  event.update_element(self)
end