Method: ArticleJSON::Elements::Text.parse_hash

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

.parse_hash(hash) ⇒ ArticleJSON::Elements::Text

Create a text element from Hash



54
55
56
57
58
59
60
61
# File 'lib/article_json/elements/text.rb', line 54

def parse_hash(hash)
  new(
    content: hash[:content],
    bold: hash[:bold],
    italic: hash[:italic],
    href: hash[:href]
  )
end