Class: Deface::DSL::Context
- Inherits:
-
Object
- Object
- Deface::DSL::Context
- Defined in:
- lib/deface/dsl/context.rb
Instance Method Summary collapse
- #attributes(values) ⇒ Object
- #closing_selector(selector) ⇒ Object
- #create_override ⇒ Object
- #disabled ⇒ Object
- #enabled ⇒ Object
-
#initialize(name) ⇒ Context
constructor
A new instance of Context.
- #original(markup) ⇒ Object
- #sequence(value) ⇒ Object
- #virtual_path(name) ⇒ Object
Constructor Details
#initialize(name) ⇒ Context
Returns a new instance of Context.
4 5 6 7 |
# File 'lib/deface/dsl/context.rb', line 4 def initialize(name) @name = name @options = {} end |
Instance Method Details
#attributes(values) ⇒ Object
54 55 56 |
# File 'lib/deface/dsl/context.rb', line 54 def attributes(values) @options[:attributes] = values end |
#closing_selector(selector) ⇒ Object
46 47 48 |
# File 'lib/deface/dsl/context.rb', line 46 def closing_selector(selector) @options[:closing_selector] = selector end |
#create_override ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/deface/dsl/context.rb', line 9 def create_override = { :name => @name, :virtual_path => @virtual_path, }.merge(@action || {}).merge(@source || {}).merge(@options) Deface::Override.new() end |
#disabled ⇒ Object
62 63 64 |
# File 'lib/deface/dsl/context.rb', line 62 def disabled @options[:disabled] = true end |
#enabled ⇒ Object
58 59 60 |
# File 'lib/deface/dsl/context.rb', line 58 def enabled @options[:disabled] = false end |
#original(markup) ⇒ Object
42 43 44 |
# File 'lib/deface/dsl/context.rb', line 42 def original(markup) @options[:original] = markup end |
#sequence(value) ⇒ Object
50 51 52 |
# File 'lib/deface/dsl/context.rb', line 50 def sequence(value) @options[:sequence] = value end |
#virtual_path(name) ⇒ Object
18 19 20 |
# File 'lib/deface/dsl/context.rb', line 18 def virtual_path(name) @virtual_path = name end |