Class: Apipony::Endpoint
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#method ⇒ Object
Returns the value of attribute method.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(method, url, &block) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #request_with(&block) ⇒ Object
- #response_with(status, &block) ⇒ Object
Constructor Details
#initialize(method, url, &block) ⇒ Endpoint
Returns a new instance of Endpoint.
4 5 6 7 8 9 |
# File 'lib/apipony/endpoint.rb', line 4 def initialize(method, url, &block) @method = method @url = set_base_url(url) instance_eval(&block) if block_given? end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/apipony/endpoint.rb', line 2 def description @description end |
#method ⇒ Object
Returns the value of attribute method.
2 3 4 |
# File 'lib/apipony/endpoint.rb', line 2 def method @method end |
#request ⇒ Object
Returns the value of attribute request.
2 3 4 |
# File 'lib/apipony/endpoint.rb', line 2 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
2 3 4 |
# File 'lib/apipony/endpoint.rb', line 2 def response @response end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/apipony/endpoint.rb', line 2 def url @url end |