Class: Kentaa::Api::Resources::Photo

Inherits:
Object
  • Object
show all
Defined in:
lib/kentaa/api/resources/photo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Photo

Returns a new instance of Photo.



11
12
13
# File 'lib/kentaa/api/resources/photo.rb', line 11

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



9
10
11
# File 'lib/kentaa/api/resources/photo.rb', line 9

def data
  @data
end

Instance Method Details

#created_atObject



19
20
21
# File 'lib/kentaa/api/resources/photo.rb', line 19

def created_at
  Time.parse(data[:created_at]) if data[:created_at]
end

#idObject



15
16
17
# File 'lib/kentaa/api/resources/photo.rb', line 15

def id
  data[:id]
end

#updated_atObject



23
24
25
# File 'lib/kentaa/api/resources/photo.rb', line 23

def updated_at
  Time.parse(data[:updated_at]) if data[:updated_at]
end

#urlObject



27
28
29
# File 'lib/kentaa/api/resources/photo.rb', line 27

def url
  data[:url]
end