Class: Devproxy::Options
- Inherits:
-
Struct
- Object
- Struct
- Devproxy::Options
- Defined in:
- lib/devproxy/options.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#listen ⇒ Object
Returns the value of attribute listen.
-
#port ⇒ Object
Returns the value of attribute port.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#remote_port ⇒ Object
Returns the value of attribute remote_port.
-
#user ⇒ Object
Returns the value of attribute user.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def host @host end |
#listen ⇒ Object
Returns the value of attribute listen
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def listen @listen end |
#port ⇒ Object
Returns the value of attribute port
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def port @port end |
#proxy ⇒ Object
Returns the value of attribute proxy
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def proxy @proxy end |
#remote_port ⇒ Object
Returns the value of attribute remote_port
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def remote_port @remote_port end |
#user ⇒ Object
Returns the value of attribute user
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def user @user end |
#verbose ⇒ Object
Returns the value of attribute verbose
2 3 4 |
# File 'lib/devproxy/options.rb', line 2 def verbose @verbose end |
Class Method Details
.default ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/devproxy/options.rb', line 14 def self.default default = new default.host = "ssh.devproxy.io" default.remote_port = 2222 default.port = 3000 default.listen = "0.0.0.0" default.verbose = false default end |
Instance Method Details
#app_host ⇒ Object
11 12 13 |
# File 'lib/devproxy/options.rb', line 11 def app_host host.split(".")[-2..-1].join(".") end |
#username ⇒ Object
3 4 5 |
# File 'lib/devproxy/options.rb', line 3 def username "devproxy-#{user}" if !!user && !user.empty? end |
#valid? ⇒ Boolean
6 7 8 9 10 |
# File 'lib/devproxy/options.rb', line 6 def valid? !( user.nil? || user.empty? || port.nil? || remote_port.nil? || host.nil? || host.empty? ) end |