class Dato::Local::FieldType::Seo
Attributes
description[R]
title[R]
twitter_card[R]
Public Class Methods
new(title, description, image, twitter_card, repo)
click to toggle source
# File lib/dato/local/field_type/seo.rb, line 13 def initialize(title, description, image, twitter_card, repo) @title = title @description = description @image = image @repo = repo @twitter_card = twitter_card end
parse(value, repo)
click to toggle source
# File lib/dato/local/field_type/seo.rb, line 9 def self.parse(value, repo) value && new(value[:title], value[:description], value[:image], value[:twitter_card], repo) end
Public Instance Methods
image()
click to toggle source
# File lib/dato/local/field_type/seo.rb, line 21 def image @image && UploadId.parse(@image, @repo) end
to_hash(*args)
click to toggle source
# File lib/dato/local/field_type/seo.rb, line 25 def to_hash(*args) { title: title, description: description, image: image && image.to_hash(*args), } end