Class: GovukPublishingComponents::Presenters::MetaTags
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::MetaTags
- Defined in:
- lib/govuk_publishing_components/presenters/meta_tags.rb
Constant Summary collapse
- FORMATS_THAT_MIGHT_INCLUDE_POSTCODES =
%w[smart_answer finder local_transaction place special_route transaction].freeze
Instance Attribute Summary collapse
-
#content_item ⇒ Object
readonly
Returns the value of attribute content_item.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#local_assigns ⇒ Object
readonly
Returns the value of attribute local_assigns.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(content_item, local_assigns, request) ⇒ MetaTags
constructor
A new instance of MetaTags.
- #meta_tags ⇒ Object
Constructor Details
#initialize(content_item, local_assigns, request) ⇒ MetaTags
Returns a new instance of MetaTags.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 8 def initialize(content_item, local_assigns, request) # We have to call deep_symbolize_keys because we're often dealing with a # parsed JSON document which will have string keys by default, but our # components use symbol keys and we want consistency. @content_item = content_item.to_h.deep_symbolize_keys @details = @content_item[:details] || {} @links = @content_item[:links] || {} @local_assigns = local_assigns @request = request end |
Instance Attribute Details
#content_item ⇒ Object (readonly)
Returns the value of attribute content_item.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 6 def content_item @content_item end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 6 def details @details end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 6 def links @links end |
#local_assigns ⇒ Object (readonly)
Returns the value of attribute local_assigns.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 6 def local_assigns @local_assigns end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 6 def request @request end |
Instance Method Details
#meta_tags ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/govuk_publishing_components/presenters/meta_tags.rb', line 19 def = {} = () = () = () = () = () () end |