Class: Imageomatic::Opengraph::Model

Inherits:
Base
  • Object
show all
Defined in:
app/models/imageomatic/opengraph/model.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, properties, #properties, property

Constructor Details

This class inherits a constructor from Imageomatic::Opengraph::Base

Instance Method Details

#imageObject



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

def image
  @image ||= Image.new
end

#image=(url) ⇒ Object



17
18
19
# File 'app/models/imageomatic/opengraph/model.rb', line 17

def image=(url)
  image.url = url
end

#twitterObject



21
22
23
24
25
26
27
# File 'app/models/imageomatic/opengraph/model.rb', line 21

def twitter
  @twitter ||= Twitter.new.tap do |twitter|
    twitter.title = title
    twitter.description = description
    twitter.image = image.url
  end
end