Class: Deface::Environment
- Inherits:
-
Object
- Object
- Deface::Environment
- Defined in:
- lib/deface/environment.rb
Defined Under Namespace
Classes: Overrides
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#haml_support ⇒ Object
Returns the value of attribute haml_support.
-
#namespaced ⇒ Object
Returns the value of attribute namespaced.
-
#overrides ⇒ Object
Returns the value of attribute overrides.
-
#slim_support ⇒ Object
Returns the value of attribute slim_support.
Instance Method Summary collapse
- #actions ⇒ Object
-
#initialize ⇒ Environment
constructor
A new instance of Environment.
- #register_action(action) ⇒ Object
- #register_source(source) ⇒ Object
- #sources ⇒ Object
Constructor Details
#initialize ⇒ Environment
Returns a new instance of Environment.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/deface/environment.rb', line 10 def initialize @overrides = Overrides.new @enabled = true @haml_support = false @slim_support = false @actions = [] @sources = [] @namespaced = false Deface::DEFAULT_ACTIONS.each { |action| register_action(action) } Deface::DEFAULT_SOURCES.each { |source| register_source(source) } end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
9 10 11 |
# File 'lib/deface/environment.rb', line 9 def enabled @enabled end |
#haml_support ⇒ Object
Returns the value of attribute haml_support.
9 10 11 |
# File 'lib/deface/environment.rb', line 9 def haml_support @haml_support end |
#namespaced ⇒ Object
Returns the value of attribute namespaced.
9 10 11 |
# File 'lib/deface/environment.rb', line 9 def namespaced @namespaced end |
#overrides ⇒ Object
Returns the value of attribute overrides.
9 10 11 |
# File 'lib/deface/environment.rb', line 9 def overrides @overrides end |
#slim_support ⇒ Object
Returns the value of attribute slim_support.
9 10 11 |
# File 'lib/deface/environment.rb', line 9 def slim_support @slim_support end |
Instance Method Details
#actions ⇒ Object
28 29 30 |
# File 'lib/deface/environment.rb', line 28 def actions @actions.dup end |
#register_action(action) ⇒ Object
23 24 25 26 |
# File 'lib/deface/environment.rb', line 23 def register_action(action) @actions << action Deface::DSL::Context.define_action_method(action.to_sym) end |
#register_source(source) ⇒ Object
32 33 34 35 |
# File 'lib/deface/environment.rb', line 32 def register_source(source) @sources << source Deface::DSL::Context.define_source_method(source.to_sym) end |
#sources ⇒ Object
37 38 39 |
# File 'lib/deface/environment.rb', line 37 def sources @sources.dup end |