Class: Cohortly::TagConfig::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/cohortly/tag_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#_controllersObject

Returns the value of attribute _controllers.



67
68
69
# File 'lib/cohortly/tag_config.rb', line 67

def _controllers
  @_controllers
end

#_nameObject

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