Class: HttpModel
- Inherits:
-
Object
- Object
- HttpModel
- Defined in:
- lib/reminder-client/http_model.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :groupPath => nil, :memberName => "default", :ip => nil, :port => nil, :serviceType => nil, :serviceName => nil, }
Instance Attribute Summary collapse
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#port ⇒ Object
Returns the value of attribute port.
-
#serviceName ⇒ Object
Returns the value of attribute serviceName.
-
#serviceType ⇒ Object
Returns the value of attribute serviceType.
Instance Method Summary collapse
-
#initialize(options) ⇒ HttpModel
constructor
A new instance of HttpModel.
- #to_hash ⇒ Object
Constructor Details
#initialize(options) ⇒ HttpModel
Returns a new instance of HttpModel.
13 14 15 16 17 18 19 20 |
# File 'lib/reminder-client/http_model.rb', line 13 def initialize() raise "initialize HttpModel error, options can not be nil." if == nil #@options = DEFAULT_OPTIONS.merge(options) @ip = [:ip] @port = [:port] @serviceType = [:serviceType] @serviceName = [:serviceName] end |
Instance Attribute Details
#ip ⇒ Object
Returns the value of attribute ip.
2 3 4 |
# File 'lib/reminder-client/http_model.rb', line 2 def ip @ip end |
#port ⇒ Object
Returns the value of attribute port.
2 3 4 |
# File 'lib/reminder-client/http_model.rb', line 2 def port @port end |
#serviceName ⇒ Object
Returns the value of attribute serviceName.
2 3 4 |
# File 'lib/reminder-client/http_model.rb', line 2 def serviceName @serviceName end |
#serviceType ⇒ Object
Returns the value of attribute serviceType.
2 3 4 |
# File 'lib/reminder-client/http_model.rb', line 2 def serviceType @serviceType end |
Instance Method Details
#to_hash ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/reminder-client/http_model.rb', line 22 def to_hash { :ip => @ip, :port => @port, :serviceType => @serviceType, :serviceName => @serviceName, } end |