Class: Ambient::DSL::SchemeScope
- Inherits:
-
Object
- Object
- Ambient::DSL::SchemeScope
- Defined in:
- lib/ambient/dsl/scheme_scope.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
-
#initialize(application, target, name, parent) ⇒ SchemeScope
constructor
A new instance of SchemeScope.
- #option(option_name, value) ⇒ Object
Constructor Details
#initialize(application, target, name, parent) ⇒ SchemeScope
Returns a new instance of SchemeScope.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ambient/dsl/scheme_scope.rb', line 6 def initialize(application, target, name, parent) @application = application @target = target @name = name @parent = parent application.configure do set_parent_scheme( target: target && target.name, child: name, parent: parent ) end end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
4 5 6 |
# File 'lib/ambient/dsl/scheme_scope.rb', line 4 def application @application end |
Instance Method Details
#configure(&block) ⇒ Object
21 22 23 24 25 |
# File 'lib/ambient/dsl/scheme_scope.rb', line 21 def configure(&block) if block instance_eval(&block) end end |
#option(option_name, value) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ambient/dsl/scheme_scope.rb', line 27 def option(option_name, value) target = @target name = @name parent = @parent if target application.configure { set_option(option_name, value, target: target.name, scheme: name, parent: parent) } else application.configure { set_option(option_name, value, scheme: name, parent: parent) } end end |