Class: SrvManager::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/srv_manager/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, options = {}) ⇒ Command

Returns a new instance of Command.



9
10
11
12
13
14
# File 'lib/srv_manager/command.rb', line 9

def initialize(text, options={})
  @text = text
  @dir = File.expand_path options[:dir].to_s
  @env = options[:env] || {}
  @rvm = options[:rvm] || false
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



5
6
7
# File 'lib/srv_manager/command.rb', line 5

def dir
  @dir
end

#envObject (readonly)

Returns the value of attribute env.



6
7
8
# File 'lib/srv_manager/command.rb', line 6

def env
  @env
end

#rvmObject (readonly)

Returns the value of attribute rvm.



7
8
9
# File 'lib/srv_manager/command.rb', line 7

def rvm
  @rvm
end

#textObject (readonly)

Returns the value of attribute text.



4
5
6
# File 'lib/srv_manager/command.rb', line 4

def text
  @text
end

Instance Method Details

#to_hashObject



16
17
18
# File 'lib/srv_manager/command.rb', line 16

def to_hash
  {text: text, dir: dir, env: env, rvm: rvm}
end