Class: Giphy::SpecialGif

Inherits:
Object
  • Object
show all
Defined in:
lib/giphy/special_gif.rb

Direct Known Subclasses

FavoriteGif, FlaggedGif

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ SpecialGif

Returns a new instance of SpecialGif.



9
10
11
# File 'lib/giphy/special_gif.rb', line 9

def initialize(hash)
  @hash = hash
end

Class Method Details

.build_batch_from(array) ⇒ Object



5
6
7
# File 'lib/giphy/special_gif.rb', line 5

def self.build_batch_from(array)
  array.map { |special_gif| new(special_gif)}
end

Instance Method Details

#create_dateObject



13
14
15
# File 'lib/giphy/special_gif.rb', line 13

def create_date
  DateTime.parse(hash.fetch('create_date'))
end

#gif_idObject



17
18
19
# File 'lib/giphy/special_gif.rb', line 17

def gif_id
  hash.fetch('gif_id')
end