class Capybara::Selenium::Node::SettableValue

SettableValue encapsulates time/date field formatting

Attributes

value[R]

Public Class Methods

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

Public Instance Methods

dateable?() click to toggle source
# File lib/capybara/selenium/node.rb, line 611
def dateable?
  !value.is_a?(String) && value.respond_to?(:to_date)
end
timeable?() click to toggle source
# File lib/capybara/selenium/node.rb, line 619
def timeable?
  !value.is_a?(String) && value.respond_to?(:to_time)
end
to_date_str() click to toggle source
# File lib/capybara/selenium/node.rb, line 615
def to_date_str
  value.to_date.iso8601
end
to_datetime_str() click to toggle source
# File lib/capybara/selenium/node.rb, line 627
def to_datetime_str
  value.to_time.strftime('%Y-%m-%dT%H:%M')
end
to_s() click to toggle source
# File lib/capybara/selenium/node.rb, line 607
def to_s
  value.to_s
end
to_time_str() click to toggle source
# File lib/capybara/selenium/node.rb, line 623
def to_time_str
  value.to_time.strftime('%H:%M')
end