Class: Genderize::Io::Lookup
Constant Summary collapse
- RESPONSE_KEYS =
%w[ count country_id error language_id gender probability ].freeze
Constants inherited from Base
Base::DEFAULT_HOST, Base::HEADER_KEYS
Instance Attribute Summary
Attributes inherited from Base
#country_id, #data, #host, #language_id, #name, #request
Instance Method Summary collapse
- #determine ⇒ Object
-
#initialize(name, host: DEFAULT_HOST, country_id: nil, language_id: nil) ⇒ Lookup
constructor
A new instance of Lookup.
Methods inherited from Base
Constructor Details
#initialize(name, host: DEFAULT_HOST, country_id: nil, language_id: nil) ⇒ Lookup
Returns a new instance of Lookup.
11 12 13 14 15 |
# File 'lib/genderize/io/lookup.rb', line 11 def initialize(name, host: DEFAULT_HOST, country_id: nil, language_id: nil) super @data = {} end |
Instance Method Details
#determine ⇒ Object
17 18 19 20 21 22 |
# File 'lib/genderize/io/lookup.rb', line 17 def determine return @data unless @request.nil? @request = generate_request @data = generate_data.merge(generate_rate_limits) end |