Class: Cloudpress::Renderers::Tags
- Inherits:
-
Object
- Object
- Cloudpress::Renderers::Tags
- Defined in:
- lib/cloudpress/renderers/tags.rb
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(context, tags) ⇒ Tags
constructor
A new instance of Tags.
- #render ⇒ Object
- #wrapped_tags ⇒ Object
Constructor Details
#initialize(context, tags) ⇒ Tags
Returns a new instance of Tags.
7 8 9 10 |
# File 'lib/cloudpress/renderers/tags.rb', line 7 def initialize(context, ) @context = context @tags = [].flatten.compact end |
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
5 6 7 |
# File 'lib/cloudpress/renderers/tags.rb', line 5 def @tags end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 |
# File 'lib/cloudpress/renderers/tags.rb', line 12 def render @context.render layout: 'cloudpress/tags/tags', locals: {renderer: self} do .map(&:render).join("\n").html_safe end end |
#wrapped_tags ⇒ Object
18 19 20 |
# File 'lib/cloudpress/renderers/tags.rb', line 18 def @wrapped_tags ||= .map {|tag| Cloudpress::Renderers::Tag.new(@context, tag)} end |