Class: Flaker::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/flaker/base.rb

Direct Known Subclasses

ObjectWrapper

Instance Method Summary collapse

Constructor Details

#initialize(user = nil, password = nil) ⇒ Base

Initializes the object. Takes username and password as arguments



7
8
9
10
11
12
13
# File 'lib/flaker/base.rb', line 7

def initialize(user = nil, password = nil)
  if user && password
    self.class.basic_auth user, password
  else
    return false
  end
end

Instance Method Details

#fetch(param, options = {}) ⇒ Object



15
16
17
# File 'lib/flaker/base.rb', line 15

def fetch(param, options = {})
  Flaker::ObjectWrapper.new(self.class.get(Flaker::API_PATH + param))
end