Class: GreenButtonData::Parser::Interval

Inherits:
Object
  • Object
show all
Includes:
Utilities, SAXMachine
Defined in:
lib/green-button-data/parser/interval.rb

Instance Method Summary collapse

Methods included from Utilities

#attributes_to_hash, #class_from_name, #epoch_to_time, #first_sunday_of, #last_weekday_of, #normalize_epoch, #nth_weekday_of, #parse_datetime, #weekday_offset

Instance Method Details

#ends_at(kwargs = {}) ⇒ Object



19
20
21
# File 'lib/green-button-data/parser/interval.rb', line 19

def ends_at(kwargs = {})
  epoch_to_time @start + @duration, kwargs
end

#starts_at(kwargs = {}) ⇒ Object



15
16
17
# File 'lib/green-button-data/parser/interval.rb', line 15

def starts_at(kwargs = {})
  epoch_to_time @start, kwargs
end

#to_sObject



23
24
25
# File 'lib/green-button-data/parser/interval.rb', line 23

def to_s
  "#{starts_at} - #{ends_at}"
end