Class: Capybara::Selenium::Node::SettableValue
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/capybara/selenium/node.rb |
Overview
SettableValue
encapsulates time/date field formatting
Class Method Summary
- .new(value) ⇒ SettableValue constructor
Instance Attribute Summary
- #dateable? ⇒ Boolean readonly
- #timeable? ⇒ Boolean readonly
- #value readonly
Instance Method Summary
Constructor Details
.new(value) ⇒ SettableValue
Instance Attribute Details
#dateable? ⇒ Boolean
(readonly)
[ GitHub ]
#timeable? ⇒ Boolean
(readonly)
[ GitHub ]
#value (readonly)
[ GitHub ]# File 'lib/capybara/selenium/node.rb', line 574
attr_reader :value
Instance Method Details
#to_date_str
[ GitHub ]# File 'lib/capybara/selenium/node.rb', line 588
def to_date_str value.to_date.iso8601 end
#to_datetime_str
[ GitHub ]# File 'lib/capybara/selenium/node.rb', line 600
def to_datetime_str value.to_time.strftime('%Y-%m-%dT%H:%M') end
#to_s
[ GitHub ]# File 'lib/capybara/selenium/node.rb', line 580
def to_s value.to_s end
#to_time_str
[ GitHub ]# File 'lib/capybara/selenium/node.rb', line 596
def to_time_str value.to_time.strftime('%H:%M') end