Class: Halchemy::HttpModel::Request

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

Overview

Provides essential details about the request that was made which resulted in the Resource this is attached to

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, url, headers, body = nil) ⇒ Request

Returns a new instance of Request.



12
13
14
15
16
17
# File 'lib/halchemy/http_model.rb', line 12

def initialize(method, url, headers, body = nil)
  @method = method
  @url = url
  @headers = headers
  @body = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



10
11
12
# File 'lib/halchemy/http_model.rb', line 10

def body
  @body
end

#headersObject

Returns the value of attribute headers.



10
11
12
# File 'lib/halchemy/http_model.rb', line 10

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



10
11
12
# File 'lib/halchemy/http_model.rb', line 10

def method
  @method
end

#urlObject

Returns the value of attribute url.



10
11
12
# File 'lib/halchemy/http_model.rb', line 10

def url
  @url
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/halchemy/http_model.rb', line 19

def to_s
  "#{@method.to_s.upcase} #{@url}"
end