Class: Twitter::Photo

Inherits:
Base
  • Object
show all
Defined in:
lib/twitter/photo.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, lazy_attr_reader

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

  • other (Twiter::Photo)

Returns:

  • (Boolean)


12
13
14
# File 'lib/twitter/photo.rb', line 12

def ==(other)
  super || (other.class == self.class && other.id == self.id)
end

#sizesArray<Twitter::Size>

Returns:



17
18
19
20
21
# File 'lib/twitter/photo.rb', line 17

def sizes
  @sizes ||= Array(@attrs['sizes']).each_with_object({}) do |(key, value), object|
    object[key] = Twitter::Size.new(value)
  end
end