Class: Believe::Resources::Biscuits
- Inherits:
-
Object
- Object
- Believe::Resources::Biscuits
- Defined in:
- lib/believe/resources/biscuits.rb
Overview
Interactive endpoints for motivation and guidance
Instance Method Summary collapse
-
#get_fresh(request_options: {}) ⇒ ::Believe::Models::Biscuit
Get a single fresh biscuit with a personalized message from Ted.
-
#initialize(client:) ⇒ Biscuits
constructor
private
A new instance of Biscuits.
-
#list(limit: nil, skip: nil, request_options: {}) ⇒ ::Believe::Internal::SkipLimitPage<::Believe::Models::Biscuit>
Get a paginated list of Ted’s famous homemade biscuits! Each comes with a heartwarming message.
-
#retrieve(biscuit_id, request_options: {}) ⇒ ::Believe::Models::Biscuit
Get a specific type of biscuit by ID.
Constructor Details
#initialize(client:) ⇒ Biscuits
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Biscuits.
74 75 76 |
# File 'lib/believe/resources/biscuits.rb', line 74 def initialize(client:) @client = client end |
Instance Method Details
#get_fresh(request_options: {}) ⇒ ::Believe::Models::Biscuit
Get a single fresh biscuit with a personalized message from Ted.
62 63 64 65 66 67 68 69 |
# File 'lib/believe/resources/biscuits.rb', line 62 def get_fresh(params = {}) @client.request( method: :get, path: "biscuits/fresh", model: ::Believe::Biscuit, options: params[:request_options] ) end |
#list(limit: nil, skip: nil, request_options: {}) ⇒ ::Believe::Internal::SkipLimitPage<::Believe::Models::Biscuit>
Get a paginated list of Ted’s famous homemade biscuits! Each comes with a heartwarming message.
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/believe/resources/biscuits.rb', line 40 def list(params = {}) parsed, = ::Believe::BiscuitListParams.dump_request(params) query = ::Believe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "biscuits", query: query, page: ::Believe::Internal::SkipLimitPage, model: ::Believe::Biscuit, options: ) end |
#retrieve(biscuit_id, request_options: {}) ⇒ ::Believe::Models::Biscuit
Get a specific type of biscuit by ID.
17 18 19 20 21 22 23 24 |
# File 'lib/believe/resources/biscuits.rb', line 17 def retrieve(biscuit_id, params = {}) @client.request( method: :get, path: ["biscuits/%1$s", biscuit_id], model: ::Believe::Biscuit, options: params[:request_options] ) end |