Module: FbGraph::Connections::Picture
- Defined in:
- lib/fb_graph/connections/picture.rb
Defined Under Namespace
Modules: Updatable
Instance Method Summary collapse
-
#picture(options_or_size = {}) ⇒ Object
User can specify size in two ways: 1.
Instance Method Details
#picture(options_or_size = {}) ⇒ Object
User can specify size in two ways:
-
By type: square | small | normal | large
-
By width and height, so facebook return the closest match to the size you specified, if only one parameter is set, then facebook will return square image
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fb_graph/connections/picture.rb', line 10 def picture( = {}) = if .is_a?(String) || .is_a?(Symbol) {:type => } else end _endpoint_ = ["#{self.endpoint}/picture", .to_query].delete_if(&:blank?).join('?') if [:redirect] == false response = get .merge( :connection => :picture, # NOTE: can be removed when addressable 2.3.3+ released with this fix # https://github.com/sporkmonger/addressable/commit/421a88fed1d2f14426f15158f3712ab563581327 :redirect => 'false' ) FbGraph::Picture.new response[:data] else _endpoint_ end end |