Module: TransparencyData
- Defined in:
- lib/transparency_data.rb,
lib/transparency_data/client.rb
Defined Under Namespace
Classes: Client
Constant Summary collapse
- VERSION =
"0.0.3".freeze
Class Method Summary collapse
- .api_key ⇒ Object
- .api_key=(value) ⇒ Object
- .api_url(endpoint, version = self.api_version) ⇒ Object
-
.api_version ⇒ Object
class << self attr_accessor :api_key attr_accessor :api_version end.
- .api_version=(value) ⇒ Object
-
.configure {|_self| ... } ⇒ Object
config/initializers/transparency_data.rb (for instance).
Class Method Details
.api_key ⇒ Object
41 42 43 |
# File 'lib/transparency_data.rb', line 41 def self.api_key @api_key end |
.api_key=(value) ⇒ Object
45 46 47 |
# File 'lib/transparency_data.rb', line 45 def self.api_key=(value) @api_key = value end |
.api_url(endpoint, version = self.api_version) ⇒ Object
24 25 26 |
# File 'lib/transparency_data.rb', line 24 def self.api_url(endpoint, version = self.api_version) "http://transparencydata.com/api/#{version}#{endpoint}.json" end |
.api_version ⇒ Object
class << self
attr_accessor :api_key
attr_accessor :api_version
end
33 34 35 |
# File 'lib/transparency_data.rb', line 33 def self.api_version @api_version || "1.0" end |
.api_version=(value) ⇒ Object
37 38 39 |
# File 'lib/transparency_data.rb', line 37 def self.api_version=(value) @api_version = value end |
.configure {|_self| ... } ⇒ Object
config/initializers/transparency_data.rb (for instance)
TransparencyData.configure do |config|
config.api_key = 'api_key'
end
19 20 21 22 |
# File 'lib/transparency_data.rb', line 19 def self.configure yield self true end |