class Parkeon::Client

Attributes

body[R]

Public Class Methods

new(body) click to toggle source
# File lib/parkeon/client.rb, line 11
def initialize(body)
  @body = body
end
post(*args) click to toggle source
# File lib/parkeon/client.rb, line 7
def self.post(*args)
  new(*args).post
end

Public Instance Methods

post() click to toggle source
# File lib/parkeon/client.rb, line 15
def post
  request = Net::HTTP::Post.new(uri.request_uri)
  request.body = body
  Response.new https.request(request)
end

Private Instance Methods

endpoint() click to toggle source
# File lib/parkeon/client.rb, line 33
def endpoint
  Config.endpoint
end
https() click to toggle source
# File lib/parkeon/client.rb, line 25
def https
  Net::HTTP.new(uri.host, uri.port).tap { |client| client.use_ssl = true }
end
uri() click to toggle source
# File lib/parkeon/client.rb, line 29
def uri
  URI(endpoint)
end