Class: Ctrl::Trello

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/ctrl/api.rb

Instance Method Summary collapse

Constructor Details

#initializeTrello

Returns a new instance of Trello.



6
7
8
9
# File 'lib/ctrl/api.rb', line 6

def initialize
  @key = ::CONFIG["key"]
  @token = ::CONFIG["token"]
end

Instance Method Details

#delete(path, options = {}) ⇒ Object



26
27
28
29
# File 'lib/ctrl/api.rb', line 26

def delete(path, options = {})
  options.merge!({key: @key, token: @token})
  self.class.delete(path, options)
end

#get(path, data, options = {}) ⇒ Object



11
12
13
14
# File 'lib/ctrl/api.rb', line 11

def get(path, data, options = {})
  options.merge!({query: data, key: @key, token: @token})
  self.class.get(path + "?key=#{@key}&token=#{@token}", options)
end

#post(path, data, options = {}) ⇒ Object



16
17
18
19
# File 'lib/ctrl/api.rb', line 16

def post(path, data, options = {})
  options.merge!({query: data, key: @key, token: @token})
  self.class.post(path, options)
end

#put(path, data, options = {}) ⇒ Object



21
22
23
24
# File 'lib/ctrl/api.rb', line 21

def put(path, data, options = {})
  options.merge!({query: data, key: @key, token: @token})
  self.class.put(path, options)
end