Class: MingleHelpers::API::Client

Inherits:
MingleAPI
  • Object
show all
Defined in:
lib/helpers/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#connectionObject (readonly)

Returns the value of attribute connection.



9
10
11
# File 'lib/helpers/api.rb', line 9

def connection
  @connection
end

#serverObject (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

#projectsObject

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