Class: SonyCameraRemote::Discovery::Request
- Inherits:
-
Object
- Object
- SonyCameraRemote::Discovery::Request
- Defined in:
- lib/sony_camera_remote/discovery/request.rb
Constant Summary collapse
- TEMPLATE =
File.read(File.join(File.dirname(__FILE__), 'm_search.erb'))
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(host, port, timeout) ⇒ Request
constructor
A new instance of Request.
- #to_s ⇒ Object
Constructor Details
#initialize(host, port, timeout) ⇒ Request
Returns a new instance of Request.
9 10 11 |
# File 'lib/sony_camera_remote/discovery/request.rb', line 9 def initialize(host, port, timeout) @host, @port, @timeout = host, port, timeout end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/sony_camera_remote/discovery/request.rb', line 7 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/sony_camera_remote/discovery/request.rb', line 7 def port @port end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/sony_camera_remote/discovery/request.rb', line 7 def timeout @timeout end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 |
# File 'lib/sony_camera_remote/discovery/request.rb', line 13 def to_s b = binding result = ERB.new(TEMPLATE, 0, "").result(b) result.split("\n").join("\r\n") << ("\r\n" * 2) end |