Class: LadyGaga::Request
- Inherits:
-
Object
- Object
- LadyGaga::Request
- Includes:
- HTTParty
- Defined in:
- lib/lady_gaga/request.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#path ⇒ Object
Returns the value of attribute path.
-
#xml_path ⇒ Object
Returns the value of attribute xml_path.
-
#xml_root ⇒ Object
Returns the value of attribute xml_root.
Instance Method Summary collapse
- #<<(hash) ⇒ Object
- #body ⇒ Object
- #default_options ⇒ Object
- #get ⇒ Object
- #options ⇒ Object
- #post ⇒ Object
- #reset! ⇒ Object
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
11 12 13 |
# File 'lib/lady_gaga/request.rb', line 11 def credentials @credentials end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/lady_gaga/request.rb', line 11 def path @path end |
#xml_path ⇒ Object
Returns the value of attribute xml_path.
11 12 13 |
# File 'lib/lady_gaga/request.rb', line 11 def xml_path @xml_path end |
#xml_root ⇒ Object
Returns the value of attribute xml_root.
11 12 13 |
# File 'lib/lady_gaga/request.rb', line 11 def xml_root @xml_root end |
Instance Method Details
#<<(hash) ⇒ Object
25 26 27 |
# File 'lib/lady_gaga/request.rb', line 25 def <<(hash) .merge!(hash) end |
#body ⇒ Object
33 34 35 |
# File 'lib/lady_gaga/request.rb', line 33 def body {xml_param => .merge(credentials).to_xml(:root => xml_root, :skip_instruct => true)} end |
#default_options ⇒ Object
13 14 15 |
# File 'lib/lady_gaga/request.rb', line 13 def {} end |
#get ⇒ Object
37 38 39 40 |
# File 'lib/lady_gaga/request.rb', line 37 def get response = self.class.get(path, :query => body) Response.new(response) end |
#options ⇒ Object
21 22 23 |
# File 'lib/lady_gaga/request.rb', line 21 def @options ||= end |
#post ⇒ Object
42 43 44 45 |
# File 'lib/lady_gaga/request.rb', line 42 def post response = self.class.post(path, :body => body) Response.new(response) end |
#reset! ⇒ Object
29 30 31 |
# File 'lib/lady_gaga/request.rb', line 29 def reset! @options = end |