Sha256: 8ecb551bb7008c0462b739ad34599a5dc2b6134d57b2f1c9f88d7b10d0c87f0b

Contents?: true

Size: 943 Bytes

Versions: 10

Compression:

Stored size: 943 Bytes

Contents

require "spyke"
require "cp8_cli/trello/json_parser"
require "cp8_cli/trello/error_handler"

module Cp8Cli
  module Trello
    class Base < Spyke::Base
      require "cp8_cli/trello/board"
      require "cp8_cli/trello/card"
      require "cp8_cli/trello/label"
      require "cp8_cli/trello/list"
      require "cp8_cli/trello/member"

      include_root_in_json false
      cattr_accessor :token

      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

      def position
        self[:pos].to_f
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cp8_cli-6.0.1 lib/cp8_cli/trello/base.rb
cp8_cli-6.0.0 lib/cp8_cli/trello/base.rb
cp8_cli-5.0.0 lib/cp8_cli/trello/base.rb
cp8_cli-4.2.1 lib/cp8_cli/trello/base.rb
cp8_cli-4.2.0 lib/cp8_cli/trello/base.rb
cp8_cli-4.1.3 lib/cp8_cli/trello/base.rb
cp8_cli-4.1.2 lib/cp8_cli/trello/base.rb
cp8_cli-4.1.1 lib/cp8_cli/trello/base.rb
cp8_cli-4.1.0 lib/cp8_cli/trello/base.rb
cp8_cli-4.0.1 lib/cp8_cli/trello/base.rb