Class: GiphyAPI::Base
- Inherits:
-
Object
- Object
- GiphyAPI::Base
- Includes:
- RawDataAttributes
- Defined in:
- lib/giphy_api/resources/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from RawDataAttributes
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
49 50 51 |
# File 'lib/giphy_api/resources/base.rb', line 49 def initialize attributes = {} assign_raw_data(attributes) end |
Class Method Details
.find_with_scope(path, scope, **options) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/giphy_api/resources/base.rb', line 5 def find_with_scope path, scope, ** response = format.load get(path, ).body case scope when :all instantiate_collection(response['data'] || [], response['pagination'] || {}) when :one instantiate_record(response['data'] || {}) end end |