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