Module: FbGraph2::Edge::Picture

Included in:
Album, App, FbGraph2::Event, Page, User
Defined in:
lib/fb_graph2/edge/picture.rb

Instance Method Summary collapse

Instance Method Details

#assign(attributes) ⇒ Object



4
5
6
7
8
9
# File 'lib/fb_graph2/edge/picture.rb', line 4

def assign(attributes)
  super
  if attributes.include? :picture
    @_cached_picture = attributes[:picture]
  end
end

#picture(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/fb_graph2/edge/picture.rb', line 11

def picture(*args)
  params = args.extract_options!
  params[:type] = args.first if args.first
  picture = if @_cached_picture.present? && params.blank?
    @_cached_picture
  else
    self.get params.merge(redirect: false), edge: :picture
  end
  Struct::Picture.new picture[:data]
end