Class: Poundpay::Resource
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- Poundpay::Resource
- Defined in:
- lib/poundpay/resource.rb
Direct Known Subclasses
Class Method Summary collapse
-
.collection_path(prefix_options = {}, query_options = nil) ⇒ Object
Modified default to not use an extension.
-
.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object
Modified default to not use an extension.
-
.instantiate_collection(collection, prefix_options = {}) ⇒ Object
Handle paginated collections.
-
.new_element_path(prefix_options = {}) ⇒ Object
Modified default to not use an extension.
Instance Method Summary collapse
- #collection_name ⇒ Object
-
#encode ⇒ Object
Poundpay accepts urlencoded form parameters Ideally we should override this functionality in the format, but it’s not very straightforward to do so.
Class Method Details
.collection_path(prefix_options = {}, query_options = nil) ⇒ Object
Modified default to not use an extension
25 26 27 28 |
# File 'lib/poundpay/resource.rb', line 25 def collection_path( = {}, = nil) path = super(, ) remove_extension(path) end |
.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object
Modified default to not use an extension
13 14 15 16 |
# File 'lib/poundpay/resource.rb', line 13 def element_path(id, = {}, = nil) path = super(id, , ) remove_extension(path) end |
.instantiate_collection(collection, prefix_options = {}) ⇒ Object
Handle paginated collections
31 32 33 34 35 |
# File 'lib/poundpay/resource.rb', line 31 def instantiate_collection(collection, = {}) # TODO: Consume pages collection = collection[collection_name] super(collection, ) end |
.new_element_path(prefix_options = {}) ⇒ Object
Modified default to not use an extension
19 20 21 22 |
# File 'lib/poundpay/resource.rb', line 19 def new_element_path( = {}) path = super() remove_extension(path) end |
Instance Method Details
#collection_name ⇒ Object
49 50 51 |
# File 'lib/poundpay/resource.rb', line 49 def collection_name self.class.collection_name end |
#encode ⇒ Object
Poundpay accepts urlencoded form parameters Ideally we should override this functionality in the format, but it’s not very straightforward to do so
45 46 47 |
# File 'lib/poundpay/resource.rb', line 45 def encode urlencode(@attributes) end |