Class: Jekyll::EmbeddingsGenerator::Data

Inherits:
Object
  • Object
show all
Includes:
Jekyll::EmbeddingsGenerator
Defined in:
lib/jekyll/embeddings-generator/models/data.rb

Constant Summary

Constants included from Jekyll::EmbeddingsGenerator

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Jekyll::EmbeddingsGenerator

run

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, embedding, )
  config = Jekyll::EmbeddingsGenerator.config
  @uid = post.data[config["uid"]]
  @most_recent_edit = post.data[config["mre"]]
  @embedding = embedding
  @metadata = .to_h
  @content = post.content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



10
11
12
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10

def content
  @content
end

#embeddingObject (readonly)

Returns the value of attribute embedding.



10
11
12
# File 'lib/jekyll/embeddings-generator/models/data.rb', line 10

def embedding
  @embedding
end

#metadataObject (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_editObject (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

#uidObject (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_hObject



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