Sha256: 289a698f66ea07982898f5d3c8b5e06fa475b7dc5d4d188784d1f7ece32f9173

Contents?: true

Size: 736 Bytes

Versions: 8

Compression:

Stored size: 736 Bytes

Contents

require "clubhouse_ruby/version"
require "clubhouse_ruby/constants"
require "clubhouse_ruby/path_builder"
require "clubhouse_ruby/request"

module ClubhouseRuby
  class Clubhouse
    include PathBuilder

    attr_accessor :token, :response_format

    # This is the basic object to interact with the clubhouse api. An api token
    # is required, and optionally the response format can be set.
    #
    def initialize(token, response_format: :json)
      raise ArgumentError unless input_valid?(token, response_format)

      self.token = token
      self.response_format = response_format
    end

    private

    def input_valid?(token, response_format)
      !token.nil? && FORMATS.keys.include?(response_format)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
clubhouse_ruby-0.10.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.8.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.7.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.6.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.5.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.4.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.3.0 lib/clubhouse_ruby.rb
clubhouse_ruby-0.2.0 lib/clubhouse_ruby.rb