Class: Tataru::Quest
- Inherits:
-
Object
- Object
- Tataru::Quest
- Defined in:
- lib/tataru/quest.rb
Overview
tataru
Instance Attribute Summary collapse
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
Instance Method Summary collapse
- #construct(&block) ⇒ Object
- #extant_dependencies ⇒ Object
- #extant_resources ⇒ Object
-
#initialize(pool, current_state = {}) ⇒ Quest
constructor
A new instance of Quest.
- #instr_hash ⇒ Object
- #remote_ids ⇒ Object
Constructor Details
Instance Attribute Details
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
6 7 8 |
# File 'lib/tataru/quest.rb', line 6 def dsl @dsl end |
Instance Method Details
#construct(&block) ⇒ Object
14 15 16 |
# File 'lib/tataru/quest.rb', line 14 def construct(&block) @dsl.instance_eval(&block) end |
#extant_dependencies ⇒ Object
30 31 32 33 34 |
# File 'lib/tataru/quest.rb', line 30 def extant_dependencies @current_state.map do |resname, info| [resname, info[:dependencies]] end.to_h end |
#extant_resources ⇒ Object
18 19 20 21 22 |
# File 'lib/tataru/quest.rb', line 18 def extant_resources @current_state.map do |resname, info| [resname, info[:desc]] end.to_h end |
#instr_hash ⇒ Object
36 37 38 39 40 41 |
# File 'lib/tataru/quest.rb', line 36 def instr_hash c = Compiler.new(@dsl, extant_resources, extant_dependencies) result = c.instr_hash result[:init][:remote_ids] = remote_ids result end |
#remote_ids ⇒ Object
24 25 26 27 28 |
# File 'lib/tataru/quest.rb', line 24 def remote_ids @current_state.map do |resname, info| [resname, info[:name]] end.to_h end |