Class: Rb::Lomo::Avatar

Inherits:
Object
  • Object
show all
Defined in:
lib/rb-lomo/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_object) ⇒ Avatar

Returns a new instance of Avatar.



22
23
24
25
26
# File 'lib/rb-lomo/user.rb', line 22

def initialize json_object
  @url   = json_object['url']
  @width = json_object['width']
  @height= json_object['height']
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'lib/rb-lomo/user.rb', line 20

def url
  @url
end

Instance Method Details

#sizeObject



28
29
30
31
32
33
# File 'lib/rb-lomo/user.rb', line 28

def size
  {
    width: @width,
    height: @height
  }
end