Class: Client
- Inherits:
-
Object
- Object
- Client
- Defined in:
- lib/icwot/client.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#port ⇒ Object
Returns the value of attribute port.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 |
# File 'lib/icwot/client.rb', line 4 def initialize( = {}) @content_type = [:content_type] || 'application/json' @uri = [:uri] @port = [:port] end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
2 3 4 |
# File 'lib/icwot/client.rb', line 2 def content_type @content_type end |
#port ⇒ Object
Returns the value of attribute port.
2 3 4 |
# File 'lib/icwot/client.rb', line 2 def port @port end |
#uri ⇒ Object
Returns the value of attribute uri.
2 3 4 |
# File 'lib/icwot/client.rb', line 2 def uri @uri end |
Instance Method Details
#to_s ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/icwot/client.rb', line 14 def to_s case content_type when 'application/json' to_hash.to_json when 'application/xml' to_xml end end |