Class: Flickrie::MediaContext

Inherits:
Object
  • Object
show all
Defined in:
lib/flickrie/objects/media_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, api_caller) ⇒ MediaContext

Returns a new instance of MediaContext.



10
11
12
13
14
15
# 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

Instance Attribute Details

#countFixnum (readonly)

Returns:

  • (Fixnum)


4
5
6
# File 'lib/flickrie/objects/media_context.rb', line 4

def count
  @count
end

#nextFlickrie::Photo, Flickrie::Video (readonly)



8
9
10
# File 'lib/flickrie/objects/media_context.rb', line 8

def next
  @next
end

#previousFlickrie::Photo, Flickrie::Video (readonly)



6
7
8
# File 'lib/flickrie/objects/media_context.rb', line 6

def previous
  @previous
end