Class: Kakaxi::Data::Timelapse

Inherits:
Object
  • Object
show all
Defined in:
lib/kakaxi/data/timelapse.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, start_datetime: nil, end_datetime: nil, url: nil, thumbnail_name: nil, thumbnail_url: nil) ⇒ Timelapse

Returns a new instance of Timelapse.



8
9
10
11
12
13
14
# File 'lib/kakaxi/data/timelapse.rb', line 8

def initialize(id: nil, start_datetime: nil, end_datetime: nil, url: nil, thumbnail_name: nil, thumbnail_url: nil)
  @id = id
  @start_datetime = DateTime.strptime(start_datetime, '%Y-%m-%dT%H:%M:%SZ')
  @end_datetime = DateTime.strptime(end_datetime, '%Y-%m-%dT%H:%M:%SZ')
  @url = URI.parse(url)
  @thumbnail = { name: thumbnail_name, url: thumbnail_url }
end

Instance Attribute Details

#end_datetimeObject (readonly)

Returns the value of attribute end_datetime.



6
7
8
# File 'lib/kakaxi/data/timelapse.rb', line 6

def end_datetime
  @end_datetime
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/kakaxi/data/timelapse.rb', line 6

def id
  @id
end

#start_datetimeObject (readonly)

Returns the value of attribute start_datetime.



6
7
8
# File 'lib/kakaxi/data/timelapse.rb', line 6

def start_datetime
  @start_datetime
end

#thumbnailObject (readonly)

Returns the value of attribute thumbnail.



6
7
8
# File 'lib/kakaxi/data/timelapse.rb', line 6

def thumbnail
  @thumbnail
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/kakaxi/data/timelapse.rb', line 6

def url
  @url
end