Class: Twfy::Client
- Inherits:
-
Object
- Object
- Twfy::Client
- Defined in:
- lib/twfy/client.rb
Defined Under Namespace
Constant Summary
Constants included from API
API::VALIDATIONS, API::VERSION
Instance Method Summary collapse
-
#initialize(api_key, log_to = $stderr) ⇒ Client
constructor
A new instance of Client.
- #log(message, level = :info) ⇒ Object
Methods included from Commands
#comments, #committee, #constituencies, #constituency, #convert_url, #debates, #geometry, #lord, #lords, #mlas, #mp, #mp_info, #mps, #msps, #wms, #wrans
Constructor Details
#initialize(api_key, log_to = $stderr) ⇒ Client
Returns a new instance of Client.
16 17 18 19 |
# File 'lib/twfy/client.rb', line 16 def initialize(api_key, log_to=$stderr) @api_key = api_key @logger = Logger.new(log_to) end |
Instance Method Details
#log(message, level = :info) ⇒ Object
21 22 23 |
# File 'lib/twfy/client.rb', line 21 def log(, level=:info) @logger.send(level, ) if $DEBUG end |