Class: Ergo::System
Overview
A system stores defined states and rules and books, which are subsystems.
Instance Attribute Summary collapse
-
#books ⇒ Hash
readonly
Map of books by name.
Attributes inherited from Book
#name, #rules, #scripts, #session, #states
Instance Method Summary collapse
-
#book(name, &block) ⇒ Book
Books are stored with rules to preserve order of application.
-
#initialize(script = nil, options = {}) ⇒ System
constructor
Initialize new System instance.
Methods inherited from Book
#clear_rule_options, #desc, #env, #file, #get_rule_options, #ignore, #ignore!, #import, #mark, #notify, #private, #rule, #state, #state?
Constructor Details
#initialize(script = nil, options = {}) ⇒ System
Initialize new System instance.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ergo/system.rb', line 17 def initialize(script=nil, ={}) extend self extend ShellUtils @ignore = [:ignore] || Ignore.new @session = OpenStruct.new @scripts = [] @rules = [] @states = {} @books = {} @digests = {} import script if script end |
Instance Attribute Details
#books ⇒ Hash (readonly)
Map of books by name.
36 37 38 |
# File 'lib/ergo/system.rb', line 36 def books @books end |