Class: WebHDFS::Proxy
- Inherits:
-
Object
- Object
- WebHDFS::Proxy
- Defined in:
- lib/webhdfs/proxy.rb
Overview
Proxy class for http requests
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#authentication? ⇒ Boolean
Proxy has authentication?.
-
#credentials(user, password) ⇒ Object
Set authentication credentials.
-
#initialize(address, port) ⇒ Proxy
constructor
Constructor.
Constructor Details
#initialize(address, port) ⇒ Proxy
Constructor
7 8 9 10 11 |
# File 'lib/webhdfs/proxy.rb', line 7 def initialize(address, port) @address = address @port = port @user = @password = nil end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/webhdfs/proxy.rb', line 4 def address @address end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/webhdfs/proxy.rb', line 4 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
4 5 6 |
# File 'lib/webhdfs/proxy.rb', line 4 def port @port end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/webhdfs/proxy.rb', line 4 def user @user end |
Instance Method Details
#authentication? ⇒ Boolean
Proxy has authentication?
20 21 22 23 24 25 26 |
# File 'lib/webhdfs/proxy.rb', line 20 def authentication? if @user && @password true else false end end |
#credentials(user, password) ⇒ Object
Set authentication credentials
14 15 16 17 |
# File 'lib/webhdfs/proxy.rb', line 14 def credentials(user, password) @user = user @password = password end |