Class: FreshBooks::Client::NamespaceProxy
- Inherits:
-
Struct
- Object
- Struct
- FreshBooks::Client::NamespaceProxy
- Defined in:
- lib/freshbooks.rb
Overview
nothing to see hereā¦
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
115 116 117 118 119 120 121 122 123 |
# File 'lib/freshbooks.rb', line 115 def method_missing(sym, *args) # check for subordinate resources if [:invoice, :recurring].include?(namespace) and sym == :lines NamespaceProxy.new client, "#{namespace}.#{sym}" else client.post "#{namespace}.#{sym}", *args end end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client
114 115 116 |
# File 'lib/freshbooks.rb', line 114 def client @client end |
#namespace ⇒ Object
Returns the value of attribute namespace
114 115 116 |
# File 'lib/freshbooks.rb', line 114 def namespace @namespace end |