Class: TargetScope
- Inherits:
-
Object
- Object
- TargetScope
- Defined in:
- lib/dsl.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
-
#initialize(name) ⇒ TargetScope
constructor
A new instance of TargetScope.
- #option(option_name, value) ⇒ Object
- #scheme(name, parent: nil, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ TargetScope
Returns a new instance of TargetScope.
71 72 73 |
# File 'lib/dsl.rb', line 71 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
69 70 71 |
# File 'lib/dsl.rb', line 69 def name @name end |
Instance Method Details
#configure(&block) ⇒ Object
75 76 77 |
# File 'lib/dsl.rb', line 75 def configure(&block) instance_eval(&block) end |
#option(option_name, value) ⇒ Object
79 80 81 82 |
# File 'lib/dsl.rb', line 79 def option(option_name, value) target_name = @name Ambient.configure { set_option(option_name, value, target: target_name) } end |
#scheme(name, parent: nil, &block) ⇒ Object
84 85 86 |
# File 'lib/dsl.rb', line 84 def scheme(name, parent: nil, &block) SchemeScope.new(self, name, parent).configure(&block) end |