Class: Dato::Local::FieldType::Seo

Inherits:
Object
  • Object
show all
Defined in:
lib/dato/local/field_type/seo.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, description, image) ⇒ Seo

Returns a new instance of Seo.



12
13
14
15
16
# File 'lib/dato/local/field_type/seo.rb', line 12

def initialize(title, description, image)
  @title = title
  @description = description
  @image = image
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/dato/local/field_type/seo.rb', line 6

def description
  @description
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/dato/local/field_type/seo.rb', line 6

def title
  @title
end

Class Method Details

.parse(value, _repo) ⇒ Object



8
9
10
# File 'lib/dato/local/field_type/seo.rb', line 8

def self.parse(value, _repo)
  new(value[:title], value[:description], value[:image])
end

Instance Method Details

#imageObject



18
19
20
# File 'lib/dato/local/field_type/seo.rb', line 18

def image
  @image && Image.parse(@image, nil)
end