Class: Giphy::Artist
- Inherits:
-
Object
- Object
- Giphy::Artist
- Defined in:
- lib/giphy/artist.rb
Class Method Summary collapse
Instance Method Summary collapse
- #avatar ⇒ Object
- #count ⇒ Object
-
#initialize(hash) ⇒ Artist
constructor
A new instance of Artist.
- #name ⇒ Object
- #username ⇒ Object
- #website ⇒ Object
Constructor Details
#initialize(hash) ⇒ Artist
Returns a new instance of Artist.
7 8 9 |
# File 'lib/giphy/artist.rb', line 7 def initialize(hash) @hash = hash end |
Class Method Details
.build_batch_from(array) ⇒ Object
3 4 5 |
# File 'lib/giphy/artist.rb', line 3 def self.build_batch_from(array) array.map { |artist| new(artist) } end |
Instance Method Details
#avatar ⇒ Object
15 16 17 |
# File 'lib/giphy/artist.rb', line 15 def avatar URI(hash.fetch('avatar')) end |
#count ⇒ Object
27 28 29 |
# File 'lib/giphy/artist.rb', line 27 def count hash.fetch('count').to_i end |
#name ⇒ Object
23 24 25 |
# File 'lib/giphy/artist.rb', line 23 def name hash.fetch('name') end |
#username ⇒ Object
11 12 13 |
# File 'lib/giphy/artist.rb', line 11 def username hash.fetch('username') end |
#website ⇒ Object
19 20 21 |
# File 'lib/giphy/artist.rb', line 19 def website URI(hash.fetch('website')) end |