Class: Cohortly::TagConfig::Tag
- Inherits:
-
Object
- Object
- Cohortly::TagConfig::Tag
- Defined in:
- lib/cohortly/tag_config.rb
Instance Attribute Summary collapse
-
#_controllers ⇒ Object
Returns the value of attribute _controllers.
-
#_name ⇒ Object
Returns the value of attribute _name.
Instance Method Summary collapse
- #controller(controller_name, &block) ⇒ Object
- #controllers(*args) ⇒ Object
-
#initialize(tag_name, &block) ⇒ Tag
constructor
A new instance of Tag.
Constructor Details
#initialize(tag_name, &block) ⇒ Tag
Returns a new instance of Tag.
68 69 70 71 72 |
# File 'lib/cohortly/tag_config.rb', line 68 def initialize(tag_name, &block) self._controllers ||= [] self._name = tag_name.to_sym instance_eval(&block) end |
Instance Attribute Details
#_controllers ⇒ Object
Returns the value of attribute _controllers.
67 68 69 |
# File 'lib/cohortly/tag_config.rb', line 67 def _controllers @_controllers end |
#_name ⇒ Object
Returns the value of attribute _name.
67 68 69 |
# File 'lib/cohortly/tag_config.rb', line 67 def _name @_name end |
Instance Method Details
#controller(controller_name, &block) ⇒ Object
73 74 75 |
# File 'lib/cohortly/tag_config.rb', line 73 def controller(controller_name, &block) _controllers << Controller.new(controller_name, &block) end |
#controllers(*args) ⇒ Object
76 77 78 |
# File 'lib/cohortly/tag_config.rb', line 76 def controllers(*args) args.each { |name| controller(name) { actions :_all } } end |