Class: Cp8Cli::Trello::Base

Inherits:
Spyke::Base
  • Object
show all
Defined in:
lib/cp8_cli/trello/base.rb

Direct Known Subclasses

Board, Card, Label, List, Member

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure(key:, token:) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cp8_cli/trello/base.rb', line 17

def self.configure(key:, token:)
  self.connection = Faraday.new(url: "https://api.trello.com/1", params: { key: key, token: token }) do |c|
    c.request  :json
    c.use JSONParser
    c.use ErrorHandler
    c.adapter  Faraday.default_adapter

    # For trello api logging
    # require "faraday/conductivity"
    # c.use       Faraday::Conductivity::ExtendedLogging
  end
  self.token = token
end

Instance Method Details

#positionObject



31
32
33
# File 'lib/cp8_cli/trello/base.rb', line 31

def position
  self[:pos].to_f
end