Class: Jekyll::WebmentionIO::WebmentionItem
- Inherits:
-
Object
- Object
- Jekyll::WebmentionIO::WebmentionItem
- Defined in:
- lib/jekyll/webmention_io/webmention_item.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(mention) ⇒ WebmentionItem
constructor
A new instance of WebmentionItem.
- #to_hash ⇒ Object
Constructor Details
#initialize(mention) ⇒ WebmentionItem
Returns a new instance of WebmentionItem.
15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/webmention_io/webmention_item.rb', line 15 def initialize(mention) @raw = mention @uri = determine_uri @source = determine_source @id = determine_id @type = determine_type end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
13 14 15 |
# File 'lib/jekyll/webmention_io/webmention_item.rb', line 13 def hash @hash end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/jekyll/webmention_io/webmention_item.rb', line 13 def id @id end |
Instance Method Details
#to_hash ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/jekyll/webmention_io/webmention_item.rb', line 24 def to_hash gather_content the_hash = { 'id' => @id, 'uri' => @uri, 'source' => @source, 'pubdate' => @pubdate, 'raw' => @raw, 'author' => @author, 'type' => @type, } the_hash['title'] = @title if @title the_hash['content'] = @content || '' the_hash end |