Class: Edamam::Client
- Inherits:
-
Object
- Object
- Edamam::Client
- Defined in:
- lib/edamam-ruby/client.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#app_key ⇒ Object
Returns the value of attribute app_key.
-
#food_database ⇒ Object
Returns the value of attribute food_database.
Instance Method Summary collapse
-
#initialize(**args) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(**args) {|_self| ... } ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 10 11 |
# File 'lib/edamam-ruby/client.rb', line 4 def initialize(**args) args.each_pair do |attribute, value| instance_variable_set("@#{attribute}", value) end yield self if block_given? raise_error_if_keys_not_present unless app_key && app_id @food_database = FoodDatabase.new(self) end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
3 4 5 |
# File 'lib/edamam-ruby/client.rb', line 3 def app_id @app_id end |
#app_key ⇒ Object
Returns the value of attribute app_key.
3 4 5 |
# File 'lib/edamam-ruby/client.rb', line 3 def app_key @app_key end |
#food_database ⇒ Object
Returns the value of attribute food_database.
3 4 5 |
# File 'lib/edamam-ruby/client.rb', line 3 def food_database @food_database end |