Class: Trebor::With
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Attributes included from Domain
Instance Method Summary collapse
- #fetch(command) ⇒ Object
-
#initialize(parent, environment) ⇒ With
constructor
A new instance of With.
Methods included from InnerDomain
Methods included from Domain
Constructor Details
#initialize(parent, environment) ⇒ With
Returns a new instance of With.
7 8 9 10 11 12 13 14 15 |
# File 'lib/trebor/with.rb', line 7 def initialize(parent, environment) @environment = environment.map do |key, val| "#{key.upcase}=#{val}" end.join(" ") @command = parent.command @parent = parent self.extend @command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
5 6 7 |
# File 'lib/trebor/with.rb', line 5 def command @command end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
5 6 7 |
# File 'lib/trebor/with.rb', line 5 def environment @environment end |
Instance Method Details
#fetch(command) ⇒ Object
17 18 19 |
# File 'lib/trebor/with.rb', line 17 def fetch(command) parent.fetch("%s %s" % [environment, command]) end |