Class: BandPage::Client

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

Constant Summary collapse

CONNECTIONS =
[:emails, :events, :genres, :tracks, :photos, :videos, :websites]
BASE_URL =
'https://api-read.bandpage.com/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



10
11
12
# File 'lib/band_page/client.rb', line 10

def initialize(config)
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



18
19
20
21
# File 'lib/band_page/client.rb', line 18

def method_missing(m, *args, &block)
  return get(m) if CONNECTIONS.include?(m)
  super
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



9
10
11
# File 'lib/band_page/client.rb', line 9

def config
  @config
end

#tokenObject

Returns the value of attribute token.



9
10
11
# File 'lib/band_page/client.rb', line 9

def token
  @token
end

Instance Method Details

#bandObject



14
15
16
# File 'lib/band_page/client.rb', line 14

def band
  get
end