Module: Benny::DSL
- Included in:
- Benny
- Defined in:
- lib/benny/dsl.rb
Defined Under Namespace
Classes: Definition
Instance Attribute Summary collapse
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
Instance Method Summary collapse
- #benchmarks ⇒ Object
- #configuration ⇒ Object
- #configure {|configuration| ... } ⇒ Object
- #define(&block) ⇒ Object
- #load(path) ⇒ Object
Instance Attribute Details
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
67 68 69 |
# File 'lib/benny/dsl.rb', line 67 def definitions @definitions end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
67 68 69 |
# File 'lib/benny/dsl.rb', line 67 def environments @environments end |
Instance Method Details
#benchmarks ⇒ Object
51 52 53 |
# File 'lib/benny/dsl.rb', line 51 def benchmarks definitions.flat_map(&:benchmarks) end |
#configuration ⇒ Object
59 60 61 |
# File 'lib/benny/dsl.rb', line 59 def configuration @configuration ||= Configuration.new end |
#configure {|configuration| ... } ⇒ Object
63 64 65 |
# File 'lib/benny/dsl.rb', line 63 def configure yield(configuration) end |
#define(&block) ⇒ Object
46 47 48 49 |
# File 'lib/benny/dsl.rb', line 46 def define(&block) @definitions ||= [] @definitions << Definition.new(&block) end |
#load(path) ⇒ Object
55 56 57 |
# File 'lib/benny/dsl.rb', line 55 def load(path) instance_eval(File.read(path), path, 1) end |