Class: Mypeople::Configuration
- Inherits:
-
Object
- Object
- Mypeople::Configuration
- Defined in:
- lib/mypeople/client.rb
Constant Summary collapse
- CONFIGURABLE_ATTRIBUTES =
[ :host, :key ]
Class Method Summary collapse
Instance Method Summary collapse
- #attributes=(attrs = {}) ⇒ Object
- #data ⇒ Object
- #http ⇒ Object
-
#initialize(attrs = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(attrs = {}) ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 |
# File 'lib/mypeople/client.rb', line 19 def initialize(attrs = {}) self.attributes = attrs end |
Class Method Details
.configurable_attributes ⇒ Object
15 16 17 |
# File 'lib/mypeople/client.rb', line 15 def self.configurable_attributes CONFIGURABLE_ATTRIBUTES end |
Instance Method Details
#attributes=(attrs = {}) ⇒ Object
23 24 25 |
# File 'lib/mypeople/client.rb', line 23 def attributes=(attrs = {}) attrs.each { |key, value| instance_variable_set("@#{key}", value) } end |
#data ⇒ Object
35 36 37 |
# File 'lib/mypeople/client.rb', line 35 def data @data = {"apikey" => @key} end |
#http ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/mypeople/client.rb', line 27 def http uri = URI.parse(self.host) @http ||= Net::HTTP.new(uri.host, uri.port) @http.use_ssl = true @http.verify_mode = OpenSSL::SSL::VERIFY_NONE @http end |