Class: Decidim::ContentParsers::ProposalParser
- Inherits:
-
ResourceParser
- Object
- ResourceParser
- Decidim::ContentParsers::ProposalParser
- Defined in:
- lib/decidim/content_parsers/proposal_parser.rb
Overview
A parser that searches mentions of Proposals in content.
This parser accepts two ways for linking Proposals.
-
Using a standard url starting with http or https.
-
With a word starting with ‘~` and digits afterwards will be considered a possible mentioned proposal.
For example ‘~1234`, but no `~ 1234`.
Also fills a ‘Metadata#linked_proposals` attribute.
Defined Under Namespace
Classes: Metadata
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(content, context) ⇒ ProposalParser
constructor
A new instance of ProposalParser.
Constructor Details
#initialize(content, context) ⇒ ProposalParser
Returns a new instance of ProposalParser.
22 23 24 25 |
# File 'lib/decidim/content_parsers/proposal_parser.rb', line 22 def initialize(content, context) super @metadata = Metadata.new([]) end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
28 29 30 |
# File 'lib/decidim/content_parsers/proposal_parser.rb', line 28 def @metadata end |