Class: Perron::Metatags
- Inherits:
-
Object
- Object
- Perron::Metatags
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/perron/metatags.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Metatags
constructor
A new instance of Metatags.
- #render(options = {}) ⇒ Object
Constructor Details
#initialize(data) ⇒ Metatags
Returns a new instance of Metatags.
7 8 9 |
# File 'lib/perron/metatags.rb', line 7 def initialize(data) @data = data end |
Instance Method Details
#render(options = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/perron/metatags.rb', line 11 def render( = {}) keys = .keys .then { [:only] ? it & [:only].map(&:to_sym) : it } .then { [:except] ? it - [:except].map(&:to_sym) : it } safe_join(keys.filter_map { [it].presence }, "\n") end |