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 448 def initialize(value) @value = value end
Public Instance Methods
dateable?()
click to toggle source
# File lib/capybara/selenium/node.rb, line 456 def dateable? !value.is_a?(String) && value.respond_to?(:to_date) end
timeable?()
click to toggle source
# File lib/capybara/selenium/node.rb, line 464 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 460 def to_date_str value.to_date.iso8601 end
to_datetime_str()
click to toggle source
# File lib/capybara/selenium/node.rb, line 472 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 452 def to_s value.to_s end
to_time_str()
click to toggle source
# File lib/capybara/selenium/node.rb, line 468 def to_time_str value.to_time.strftime('%H:%M') end