Class: Ctrl::Trello
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, data, options = {}) ⇒ Object
-
#initialize ⇒ Trello
constructor
A new instance of Trello.
- #post(path, data, options = {}) ⇒ Object
- #put(path, data, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Trello
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, = {}) .merge!({key: @key, token: @token}) self.class.delete(path, ) end |
#get(path, data, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/ctrl/api.rb', line 11 def get(path, data, = {}) .merge!({query: data, key: @key, token: @token}) self.class.get(path + "?key=#{@key}&token=#{@token}", ) end |
#post(path, data, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/ctrl/api.rb', line 16 def post(path, data, = {}) .merge!({query: data, key: @key, token: @token}) self.class.post(path, ) end |
#put(path, data, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/ctrl/api.rb', line 21 def put(path, data, = {}) .merge!({query: data, key: @key, token: @token}) self.class.put(path, ) end |