Module: Her::Model::HTTP::ClassMethods
- Defined in:
- lib/castle-her/model/http.rb
Overview
For each HTTP method, define these class methods:
-
<method>(path, params)
-
<method>_raw(path, params, &block)
-
<method>_collection(path, params, &block)
-
<method>_resource(path, params, &block)
-
custom_<method>(*paths)
Instance Method Summary collapse
-
#use_api(value = nil) ⇒ Object
(also: #her_api, #uses_api)
Change which API the model will use to make its HTTP requests.
Instance Method Details
#use_api(value = nil) ⇒ Object Also known as: her_api, uses_api
Change which API the model will use to make its HTTP requests
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/castle-her/model/http.rb', line 37 def use_api(value = nil) @_her_use_api ||= begin superclass.use_api if superclass.respond_to?(:use_api) end unless value return (@_her_use_api.respond_to? :call) ? @_her_use_api.call : @_her_use_api end @_her_use_api = value end |