Class: URI::SCP
- Inherits:
-
Generic
- Object
- Generic
- URI::SCP
- Includes:
- OpenURI::OpenRead
- Defined in:
- lib/uri/scp.rb,
lib/uri/open-scp.rb
Constant Summary collapse
- DEFAULT_PORT =
22
- COMPONENT =
[ :scheme, :userinfo, :host, :port, :path, :query ].freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #buffer_open(buf, proxy, open_options) ⇒ Object
-
#initialize(*args) ⇒ SCP
constructor
A new instance of SCP.
Constructor Details
#initialize(*args) ⇒ SCP
Returns a new instance of SCP.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/uri/scp.rb', line 20 def initialize(*args) super(*args) @options = Hash.new (query || "").split(/&/).each do |pair| name, value = pair.split(/=/, 2) opt_name = name.to_sym values = value.split(/,/).map { |v| v.to_i.to_s == v ? v.to_i : v } values = values.first if values.length == 1 [opt_name] = values end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/uri/scp.rb', line 14 def @options end |
Class Method Details
.new2(user, password, host, port, path, query) ⇒ Object
16 17 18 |
# File 'lib/uri/scp.rb', line 16 def self.new2(user, password, host, port, path, query) new('scp', [user, password], host, port, nil, path, nil, query) end |