Class: Instamojo::API
- Inherits:
-
Object
- Object
- Instamojo::API
- Defined in:
- lib/API/api.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(app_id = nil, options = {}) {|_self| ... } ⇒ API
constructor
A new instance of API.
- #to_s ⇒ Object
Constructor Details
#initialize(app_id = nil, options = {}) {|_self| ... } ⇒ API
Returns a new instance of API.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/API/api.rb', line 5 def initialize(app_id = nil, = {}) = app_id if app_id.is_a? Hash @app_id = app_id .each do |key, value| instance_variable_set("@#{key}", value) end yield self if block_given? end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
3 4 5 |
# File 'lib/API/api.rb', line 3 def app_id @app_id end |
Instance Method Details
#client ⇒ Object
17 18 19 |
# File 'lib/API/api.rb', line 17 def client Instamojo::Client.new(self) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/API/api.rb', line 21 def to_s sprintf("Instamojo API(key: %s)", @app_id) end |