Class: Edamam::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/edamam-ruby/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



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_idObject

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_keyObject

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_databaseObject

Returns the value of attribute food_database.



3
4
5
# File 'lib/edamam-ruby/client.rb', line 3

def food_database
  @food_database
end