class Capybara::Apparition::Node::SettableValue

SettableValue encapsulates time/date field formatting

Attributes

value[R]

Public Class Methods

new(value) click to toggle source
# File lib/capybara/apparition/node.rb, line 630
def initialize(value)
  @value = value
end

Public Instance Methods

dateable?() click to toggle source
# File lib/capybara/apparition/node.rb, line 638
def dateable?
  !value.is_a?(String) && value.respond_to?(:to_date)
end
timeable?() click to toggle source
# File lib/capybara/apparition/node.rb, line 646
def timeable?
  !value.is_a?(String) && value.respond_to?(:to_time)
end
to_date_str() click to toggle source
# File lib/capybara/apparition/node.rb, line 642
def to_date_str
  value.to_date.strftime('%Y-%m-%d')
end
to_datetime_str() click to toggle source
# File lib/capybara/apparition/node.rb, line 654
def to_datetime_str
  value.to_time.strftime('%Y-%m-%dT%H:%M')
end
to_s() click to toggle source
# File lib/capybara/apparition/node.rb, line 634
def to_s
  value.to_s
end
to_time_str() click to toggle source
# File lib/capybara/apparition/node.rb, line 650
def to_time_str
  value.to_time.strftime('%H:%M')
end