class VirtualDateElement

Attributes

attribute_name[R]
root_element[R]

Public Class Methods

new(root_element, attribute_name) click to toggle source
# File lib/tedium/virtual_date_element.rb, line 4
def initialize(root_element, attribute_name)
  @root_element = root_element
  @attribute_name = attribute_name
end

Public Instance Methods

day_element() click to toggle source
# File lib/tedium/virtual_date_element.rb, line 23
def day_element
  token_element('3i')
end
month_element() click to toggle source
# File lib/tedium/virtual_date_element.rb, line 19
def month_element
  token_element('2i')
end
set(date) click to toggle source
# File lib/tedium/virtual_date_element.rb, line 9
def set(date)
  year_element.set(date.year)
  month_element.set(date.month)
  day_element.set(date.day)
end
year_element() click to toggle source
# File lib/tedium/virtual_date_element.rb, line 15
def year_element
  token_element('1i')
end

Private Instance Methods

token_element(token) click to toggle source
# File lib/tedium/virtual_date_element.rb, line 29
def token_element(token)
  root_element.find :input_for_field, "#{attribute_name}(#{token})"
end