Module: Roar::Representer::Feature::HttpVerbs
- Included in:
- Client
- Defined in:
- lib/roar/representer/feature/http_verbs.rb
Defined Under Namespace
Modules: ClassMethods
Class Attribute Summary collapse
-
.transport_engine ⇒ Object
Returns the value of attribute transport_engine.
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #delete(*args, &block) ⇒ Object
-
#get(*args, &block) ⇒ Object
GETs
url
withformat
, deserializes the returned document and updates properties accordingly. - #patch(*args, &block) ⇒ Object
-
#post(*args, &block) ⇒ Object
Serializes the object, POSTs it to
url
withformat
, deserializes the returned document and updates properties accordingly. -
#put(*args, &block) ⇒ Object
Serializes the object, PUTs it to
url
withformat
, deserializes the returned document and updates properties accordingly.
Class Attribute Details
.transport_engine ⇒ Object
Returns the value of attribute transport_engine.
10 11 12 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 10 def transport_engine @transport_engine end |
Instance Attribute Details
#transport_engine ⇒ Object
28 29 30 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 28 def transport_engine @transport_engine || HttpVerbs.transport_engine end |
Class Method Details
.included(base) ⇒ Object
12 13 14 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 12 def included(base) base.extend ClassMethods end |
Instance Method Details
#delete(*args, &block) ⇒ Object
62 63 64 65 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 62 def delete(*args, &block) http.delete_uri(*args, &block) self end |
#get(*args, &block) ⇒ Object
GETs url
with format
, deserializes the returned document and updates properties accordingly.
41 42 43 44 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 41 def get(*args, &block) response = http.get_uri(*args, &block) handle_response(response) end |
#patch(*args, &block) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 55 def patch(*args, &block) = handle_deprecated_args(serialize, *args) response = http.patch_uri(, &block) handle_response(response) self end |
#post(*args, &block) ⇒ Object
Serializes the object, POSTs it to url
with format
, deserializes the returned document and updates properties accordingly.
34 35 36 37 38 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 34 def post(*args, &block) = handle_deprecated_args(serialize, *args) response = http.post_uri(, &block) handle_response(response) end |
#put(*args, &block) ⇒ Object
Serializes the object, PUTs it to url
with format
, deserializes the returned document and updates properties accordingly.
48 49 50 51 52 53 |
# File 'lib/roar/representer/feature/http_verbs.rb', line 48 def put(*args, &block) = handle_deprecated_args(serialize, *args) response = http.put_uri(, &block) handle_response(response) self end |