Class: Fogbugz::Adapter::HTTP::Typhoeuser

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_fogbugz/adapters/http/typhoeus.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Typhoeuser

Returns a new instance of Typhoeuser.



9
10
11
12
# File 'lib/ruby_fogbugz/adapters/http/typhoeus.rb', line 9

def initialize(options = {})
  @uri = options[:uri]
  @requester = Typhoeus::Request
end

Instance Attribute Details

#requesterObject

Returns the value of attribute requester.



7
8
9
# File 'lib/ruby_fogbugz/adapters/http/typhoeus.rb', line 7

def requester
  @requester
end

#uriObject

Returns the value of attribute uri.



7
8
9
# File 'lib/ruby_fogbugz/adapters/http/typhoeus.rb', line 7

def uri
  @uri
end

Instance Method Details

#request(action, options) ⇒ Object



14
15
16
17
18
19
# File 'lib/ruby_fogbugz/adapters/http/typhoeus.rb', line 14

def request(action, options)
  params = {:cmd => action}.merge(options[:params])
  query = @requester.get("#{uri}/api.asp",
                         :params => params)
  query.body
end