Class: Shushu::Client

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Client

Returns a new instance of Client.



40
41
42
# File 'lib/shushu.rb', line 40

def initialize(url)
  self.class.url = url
end

Class Method Details

.urlObject



32
33
34
35
36
37
38
# File 'lib/shushu.rb', line 32

def self.url
  if defined?(@@url)
    @@url
  else
    ENV["SHUSHU_URL"]
  end
end

.url=(url) ⇒ Object



28
29
30
# File 'lib/shushu.rb', line 28

def self.url=(url)
  @@url = url
end

Instance Method Details

#[](api) ⇒ Object



44
45
46
# File 'lib/shushu.rb', line 44

def [](api)
  Shushu.const_get(Inflector.camelize(api))
end