Method: ArticleJSON::Elements::Embed#to_h

Defined in:
lib/article_json/elements/embed.rb

#to_hHash

Hash representation of this embedded element

Returns:

  • (Hash)


20
21
22
23
24
25
26
27
28
# File 'lib/article_json/elements/embed.rb', line 20

def to_h
  {
    type: type,
    embed_type: embed_type,
    embed_id: embed_id,
    tags: tags,
    caption: caption.map(&:to_h),
  }
end