Class: Mumukit::Runner
- Inherits:
-
Object
- Object
- Mumukit::Runner
- Defined in:
- lib/mumukit/runner.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
- #configure {|@config| ... } ⇒ Object
- #configure_runtime(config) ⇒ Object
-
#initialize(name) ⇒ Runner
constructor
A new instance of Runner.
- #prefix ⇒ Object
Constructor Details
#initialize(name) ⇒ Runner
Returns a new instance of Runner.
4 5 6 |
# File 'lib/mumukit/runner.rb', line 4 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/mumukit/runner.rb', line 2 def name @name end |
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
2 3 4 |
# File 'lib/mumukit/runner.rb', line 2 def runtime @runtime end |
Class Method Details
.configure_defaults {|@default_config| ... } ⇒ Object
29 30 31 32 |
# File 'lib/mumukit/runner.rb', line 29 def self.configure_defaults @default_config ||= OpenStruct.new yield @default_config end |
.default_config ⇒ Object
25 26 27 |
# File 'lib/mumukit/runner.rb', line 25 def self.default_config @default_config end |
Instance Method Details
#config ⇒ Object
17 18 19 |
# File 'lib/mumukit/runner.rb', line 17 def config @config or raise 'This runner has not being configured yet' end |
#configure {|@config| ... } ⇒ Object
8 9 10 11 |
# File 'lib/mumukit/runner.rb', line 8 def configure @config ||= self.class.default_config.clone yield @config end |
#configure_runtime(config) ⇒ Object
13 14 15 |
# File 'lib/mumukit/runner.rb', line 13 def configure_runtime(config) @runtime = Mumukit::Runtime.new(config) end |
#prefix ⇒ Object
21 22 23 |
# File 'lib/mumukit/runner.rb', line 21 def prefix name.camelize end |