Class: MingleHelpers::API::Client
- Inherits:
-
MingleAPI
- Object
- MingleAPI
- MingleHelpers::API::Client
- Defined in:
- lib/helpers/api.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#create_card(project, attrs) ⇒ Object
Returns the card URL.
-
#initialize(server, user, hmac_token) ⇒ Client
constructor
A new instance of Client.
-
#projects ⇒ Object
Returns an array of hashes { :name, :identifier, :description }.
-
#update_card(project, card_num, attrs) ⇒ Object
Returns the card URL.
Constructor Details
#initialize(server, user, hmac_token) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 |
# File 'lib/helpers/api.rb', line 11 def initialize(server, user, hmac_token) # @server = server # @connection = MingleAPI.new(server, hmac: [user, hmac_token]) super(server, hmac: [user, hmac_token]) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
9 10 11 |
# File 'lib/helpers/api.rb', line 9 def connection @connection end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
9 10 11 |
# File 'lib/helpers/api.rb', line 9 def server @server end |
Instance Method Details
#create_card(project, attrs) ⇒ Object
Returns the card URL
24 25 26 |
# File 'lib/helpers/api.rb', line 24 def create_card(project, attrs) super(project, attrs).url end |
#projects ⇒ Object
Returns an array of hashes { :name, :identifier, :description }
19 20 21 |
# File 'lib/helpers/api.rb', line 19 def projects super.collect(&:to_h) end |
#update_card(project, card_num, attrs) ⇒ Object
Returns the card URL
29 30 31 |
# File 'lib/helpers/api.rb', line 29 def update_card(project, card_num, attrs) super(project, card_num, attrs).url end |