Class: Abstractive::TimeSpans
- Inherits:
-
Object
- Object
- Abstractive::TimeSpans
- Extended by:
- Methods
- Includes:
- Methods
- Defined in:
- lib/abstractive/timespans.rb
Defined Under Namespace
Modules: Methods
Constant Summary
Constants included from Methods
Methods::DAY, Methods::HOUR, Methods::MINUTE
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(i) ⇒ TimeSpans
constructor
A new instance of TimeSpans.
- #to_i ⇒ Object
Methods included from Methods
day_decimal, duration, minus_span, notated_time_length, plus_span, time_spans
Constructor Details
#initialize(i) ⇒ TimeSpans
Returns a new instance of TimeSpans.
67 |
# File 'lib/abstractive/timespans.rb', line 67 def initialize(i); @i = i end |
Class Method Details
.at(text, format = STANDARD_FORMAT) ⇒ Object
71 72 73 74 75 |
# File 'lib/abstractive/timespans.rb', line 71 def at(text, format=STANDARD_FORMAT) DateTime.strptime(text, format).to_time rescue => ex Abstractive[:logger].exception(ex,"Trouble turning string into DateTime and then Time object.") end |
Instance Method Details
#to_i ⇒ Object
68 |
# File 'lib/abstractive/timespans.rb', line 68 def to_i; @i end |