Class: Cut::Client

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint, parameters = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
# File 'lib/cut/client.rb', line 8

def initialize(endpoint, parameters = {})
  @endpoint = parameters.inject(endpoint) do |str, param|
    str.gsub("{{#{param.first}}}", CGI.escape(param.last))
  end
end

Class Method Details

.get(*args) ⇒ Object



4
5
6
# File 'lib/cut/client.rb', line 4

def self.get(*args)
  new(*args).get
end

Instance Method Details

#getObject



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

def get
  Response.new(HTTParty.get(endpoint))
end