Class: Jekyll::EmbeddingsGenerator::Data
- Inherits:
-
Object
- Object
- Jekyll::EmbeddingsGenerator::Data
- Includes:
- Jekyll::EmbeddingsGenerator
- Defined in:
- lib/jekyll/embeddings-generator/models/data.rb
Constant Summary
Constants included from Jekyll::EmbeddingsGenerator
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#most_recent_edit ⇒ Object
readonly
Returns the value of attribute most_recent_edit.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(post, embedding, metadata) ⇒ Data
constructor
A new instance of Data.
- #to_h ⇒ Object
Methods included from Jekyll::EmbeddingsGenerator
Constructor Details
#initialize(post, embedding, metadata) ⇒ Data
Returns a new instance of Data.
12 13 14 15 16 17 18 19 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 12 def initialize(post, , ) config = Jekyll::EmbeddingsGenerator.config @uid = post.data[config["uid"]] @most_recent_edit = post.data[config["mre"]] @embedding = @metadata = .to_h @content = post.content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
10 11 12 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10 def content @content end |
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
10 11 12 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10 def @embedding end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
10 11 12 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10 def @metadata end |
#most_recent_edit ⇒ Object (readonly)
Returns the value of attribute most_recent_edit.
10 11 12 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10 def most_recent_edit @most_recent_edit end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
10 11 12 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10 def uid @uid end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 21 def to_h { :uid => @uid, :most_recent_edit => @most_recent_edit, :embedding => @embedding, :metadata => @metadata, :content => @content, }.compact end |