Module: Roar::Client
- Includes:
- HttpVerbs
- Defined in:
- lib/roar/client.rb
Overview
Mix in HttpVerbs.
Instance Attribute Summary
Attributes included from HttpVerbs
Class Method Summary collapse
-
.extended(base) ⇒ Object
Add accessors for properties and collections to modules.
Instance Method Summary collapse
- #to_hash(options = {}) ⇒ Object
-
#to_xml(options = {}) ⇒ Object
sorry, but i’m not even sure if anyone uses this module.
Methods included from HttpVerbs
#delete, #get, included, #patch, #post, #put
Class Method Details
.extended(base) ⇒ Object
Add accessors for properties and collections to modules.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/roar/client.rb', line 10 def self.extended(base) base.instance_eval do representable_attrs.each do |attr| name = attr.name next if name == "links" # ignore hyperlinks. # TODO: could anyone please make this better? instance_eval %Q{ def #{name}=(v) @#{name} = v end def #{name} @#{name} end } end end end |
Instance Method Details
#to_hash(options = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/roar/client.rb', line 30 def to_hash(={}) # options[:links] ||= false [:user_options] ||= {} [:user_options][:links] ||= false super() end |
#to_xml(options = {}) ⇒ Object
sorry, but i’m not even sure if anyone uses this module.
38 39 40 41 42 43 |
# File 'lib/roar/client.rb', line 38 def to_xml(={}) # sorry, but i'm not even sure if anyone uses this module. [:user_options] ||= {} [:user_options][:links] ||= false super() end |