class Flickrie::MediaContext

Attributes

count[R]

@return [Fixnum]

next[R]

@return [Flickrie::Photo, Flickrie::Video]

previous[R]

@return [Flickrie::Photo, Flickrie::Video]

Public Class Methods

new(hash, api_caller) click to toggle source
# File lib/flickrie/objects/media_context.rb, line 10
def initialize(hash, api_caller)
  count = hash['count'].to_i
  previous = hash['prevphoto']['id'].to_i > 0 ? Media.new(hash['prevphoto'], api_caller) : nil
  next_ = hash['nextphoto']['id'].to_i > 0 ? Media.new(hash['nextphoto'], api_caller) : nil
  @count, @previous, @next = count, previous, next_
end