Sha256: 3b654ebe7602f7701787d0ea3cdd55f1c7355ff53a2fb5aff56c9677c449af20

Contents?: true

Size: 888 Bytes

Versions: 1

Compression:

Stored size: 888 Bytes

Contents

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

module Evrythng
  # Wrapper for the Evrythng REST API
  class Client
    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.1 lib/evrythng/client.rb