Class: Agave::Local::FieldType::Seo
- Inherits:
-
Object
- Object
- Agave::Local::FieldType::Seo
- Defined in:
- lib/agave/local/field_type/seo.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(title, description, image, repo) ⇒ Seo
constructor
A new instance of Seo.
- #to_hash(*args) ⇒ Object
Constructor Details
#initialize(title, description, image, repo) ⇒ Seo
Returns a new instance of Seo.
12 13 14 15 16 17 |
# File 'lib/agave/local/field_type/seo.rb', line 12 def initialize(title, description, image, repo) @title = title @description = description @image = image @repo = repo end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/agave/local/field_type/seo.rb', line 6 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/agave/local/field_type/seo.rb', line 6 def title @title end |
Class Method Details
.parse(value, repo) ⇒ Object
8 9 10 |
# File 'lib/agave/local/field_type/seo.rb', line 8 def self.parse(value, repo) value && new(value[:title], value[:description], value[:image], repo) end |
Instance Method Details
#image ⇒ Object
19 20 21 |
# File 'lib/agave/local/field_type/seo.rb', line 19 def image @image && File.parse(@image, @repo) end |
#to_hash(*args) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/agave/local/field_type/seo.rb', line 23 def to_hash(*args) { title: title, description: description, image: image && image.to_hash(*args) } end |