Class: SchemeScope
- Inherits:
-
Object
- Object
- SchemeScope
- Defined in:
- lib/dsl.rb
Instance Method Summary collapse
- #configure(&block) ⇒ Object
-
#initialize(target, name, parent) ⇒ SchemeScope
constructor
A new instance of SchemeScope.
- #option(option_name, value) ⇒ Object
Constructor Details
#initialize(target, name, parent) ⇒ SchemeScope
Returns a new instance of SchemeScope.
104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/dsl.rb', line 104 def initialize(target, name, parent) @target = target @name = name @parent = parent Ambient.configure do set_parent_scheme( target: target && target.name, child: name, parent: parent ) end end |
Instance Method Details
#configure(&block) ⇒ Object
118 119 120 121 122 |
# File 'lib/dsl.rb', line 118 def configure(&block) if block instance_eval(&block) end end |
#option(option_name, value) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/dsl.rb', line 124 def option(option_name, value) target = @target name = @name parent = @parent if target Ambient.configure { set_option(option_name, value, target: target.name, scheme: name, parent: parent) } else Ambient.configure { set_option(option_name, value, scheme: name, parent: parent) } end end |