Class: Muzooka

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

Constant Summary collapse

URL =
'https://devapi.muzooka.com/v2/artists'.freeze
BIO =
'bio'.freeze
IMAGE =
'image'.freeze
'socialLinks'.freeze
DATA =
'data'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(muzooka_api_key:, artist_name:) ⇒ Muzooka

Returns a new instance of Muzooka.



12
13
14
15
# File 'lib/muzooka.rb', line 12

def initialize(muzooka_api_key:, artist_name:)
  @artist_name = artist_name.strip
  @muzooka_api_key = muzooka_api_key
end

Instance Method Details

#bioObject



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

def bio
  response_body&.fetch(BIO, nil)
end

#imagesObject



21
22
23
# File 'lib/muzooka.rb', line 21

def images
  response_body&.fetch(IMAGE, nil)
end


25
26
27
# File 'lib/muzooka.rb', line 25

def social_links
  response_body&.fetch(SOCIAL_LINKS, nil)
end