Class: HTTPShell::Environment
- Inherits:
-
Object
- Object
- HTTPShell::Environment
- Defined in:
- lib/httpshell.rb
Instance Attribute Summary collapse
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
-
#working_path ⇒ Object
Returns the value of attribute working_path.
Instance Method Summary collapse
- #cd(path) ⇒ Object
-
#initialize ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize ⇒ Environment
Returns a new instance of Environment.
8 9 10 11 |
# File 'lib/httpshell.rb', line 8 def initialize @variables = {} @working_path = "http://" end |
Instance Attribute Details
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
5 6 7 |
# File 'lib/httpshell.rb', line 5 def variables @variables end |
#working_path ⇒ Object
Returns the value of attribute working_path.
6 7 8 |
# File 'lib/httpshell.rb', line 6 def working_path @working_path end |
Instance Method Details
#cd(path) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/httpshell.rb', line 13 def cd(path) if /^(http|https|file):\/\//i =~ path cd_absolutely(path) else cd_relatively(path) end end |