Sha256: bfff7e95cd8be0fc0dbaac60e3f1c2efc559e308a5c351bd776064c9c6ff8326

Contents?: true

Size: 961 Bytes

Versions: 1

Compression:

Stored size: 961 Bytes

Contents

require 'evrythng/authenticatable'
require 'evrythng/config'
require 'evrythng/connection'
require 'evrythng/request'

module Evrythng
  # Wrapper for the Evrythng REST API
  class Client
    include Evrythng::Authenticatable
    include Evrythng::Connection
    include Evrythng::Request

    require 'evrythng/client/thngs'
    include Evrythng::Client::Thngs

    require 'evrythng/client/collections'
    include Evrythng::Client::Collections

    require 'evrythng/client/properties'
    include Evrythng::Client::Properties

    require 'evrythng/client/search'
    include Evrythng::Client::Search

    attr_accessor *Config::VALID_OPTIONS_KEYS

    # Initializes a new API object
    #
    # @param attrs [Hash]
    # @return [Evrythng::Client]
    def initialize(attrs={})
      attrs = Evrythng.options.merge(attrs)
      Config::VALID_OPTIONS_KEYS.each do |key|
        instance_variable_set("@#{key}".to_sym, attrs[key])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evrythng-0.1.0 lib/evrythng/client.rb