Module: FatZebra::APIHelper
- Included in:
- APIResource
- Defined in:
- lib/fat_zebra/api_helper.rb
Overview
FatZebra Helper
Help for the api resource
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#request(method, resource_path, payload = {}, options = {}) ⇒ Hash
Send a request to the API.
-
#resource_name ⇒ String
Resource name.
-
#resource_path(path = nil) ⇒ String
Resource path.
Class Method Details
.included(base) ⇒ Object
93 94 95 |
# File 'lib/fat_zebra/api_helper.rb', line 93 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#request(method, resource_path, payload = {}, options = {}) ⇒ Hash
Send a request to the API
89 90 91 |
# File 'lib/fat_zebra/api_helper.rb', line 89 def request(method, resource_path, payload = {}, = {}) self.class.request(method, resource_path, payload, ) end |
#resource_name ⇒ String
Returns resource name.
69 70 71 |
# File 'lib/fat_zebra/api_helper.rb', line 69 def resource_name self.class.resource_name end |
#resource_path(path = nil) ⇒ String
Returns resource path.
75 76 77 |
# File 'lib/fat_zebra/api_helper.rb', line 75 def resource_path(path = nil) self.class.resource_path(path) end |