Class: Devproxy::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/devproxy/options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host

Returns:

  • the current value of host



2
3
4
# File 'lib/devproxy/options.rb', line 2

def host
  @host
end

#portObject

Returns the value of attribute port

Returns:

  • the current value of port



2
3
4
# File 'lib/devproxy/options.rb', line 2

def port
  @port
end

#proxyObject

Returns the value of attribute proxy

Returns:

  • the current value of proxy



2
3
4
# File 'lib/devproxy/options.rb', line 2

def proxy
  @proxy
end

#remote_portObject

Returns the value of attribute remote_port

Returns:

  • the current value of remote_port



2
3
4
# File 'lib/devproxy/options.rb', line 2

def remote_port
  @remote_port
end

#userObject

Returns the value of attribute user

Returns:

  • the current value of user



2
3
4
# File 'lib/devproxy/options.rb', line 2

def user
  @user
end

Class Method Details

.defaultObject



12
13
14
15
16
17
18
# File 'lib/devproxy/options.rb', line 12

def self.default
  default = new
  default.host        = "ssh.devproxy.io"
  default.remote_port = 2222
  default.port        = 3000
  default
end

Instance Method Details

#usernameObject



3
4
5
# File 'lib/devproxy/options.rb', line 3

def username
  "devproxy-#{user}"
end

#valid?Boolean

Returns:



6
7
8
9
10
11
# File 'lib/devproxy/options.rb', line 6

def valid?
  !( user.nil?  || user.empty?      ||
     proxy.nil? || proxy.empty?     ||
     port.nil?  || remote_port.nil? ||
     host.nil?  || host.empty?       )
end