Class: Imageomatic::Opengraph::Model

Inherits:
Struct
  • Object
show all
Includes:
ActionView::Helpers::OutputSafetyHelper
Defined in:
app/models/imageomatic/opengraph/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



3
4
5
# File 'app/models/imageomatic/opengraph/model.rb', line 3

def description
  @description
end

#imageObject

Returns the value of attribute image

Returns:

  • (Object)

    the current value of image



3
4
5
# File 'app/models/imageomatic/opengraph/model.rb', line 3

def image
  @image
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



3
4
5
# File 'app/models/imageomatic/opengraph/model.rb', line 3

def title
  @title
end

Instance Method Details

#metatagsObject



6
7
8
9
10
11
12
# File 'app/models/imageomatic/opengraph/model.rb', line 6

def metatags
  Enumerator.new do |y|
    each_pair do |property, content|
      y << Metatag.new(property, content) if content.present?
    end
  end
end

#to_htmlObject



14
15
16
# File 'app/models/imageomatic/opengraph/model.rb', line 14

def to_html
  safe_join metatags.map(&:to_html), "\n"
end