Class: Assonnato::Client
- Inherits:
-
Object
- Object
- Assonnato::Client
- Includes:
- Request
- Defined in:
- lib/assonnato/client.rb
Instance Attribute Summary collapse
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host = 'pigro.omnivium.it', port = 80, ssl = false) ⇒ Client
constructor
A new instance of Client.
Methods included from Request
Constructor Details
Instance Attribute Details
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
14 15 16 |
# File 'lib/assonnato/client.rb', line 14 def @cookies end |
#host ⇒ Object
Returns the value of attribute host.
13 14 15 |
# File 'lib/assonnato/client.rb', line 13 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
13 14 15 |
# File 'lib/assonnato/client.rb', line 13 def port @port end |
Class Method Details
.namespace(*names) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/assonnato/client.rb', line 23 def self.namespace(*names) = names.last.is_a?(Hash) ? names.pop : {} names = names.map(&:to_sym) name = names.pop return if public_method_defined?(name) converted = .fetch(:full_name, name).to_s converted = converted.split('_').map(&:capitalize).join class_name = '' class_name = "#{self.name.split('::').last}::" unless .fetch(:root, false) class_name += converted define_method(name) do ApiFactory.new class_name, self end self end |