Class: LinkThumbnailer::Models::Website
- Inherits:
-
LinkThumbnailer::Model
- Object
- LinkThumbnailer::Model
- LinkThumbnailer::Models::Website
- Defined in:
- lib/link_thumbnailer/models/website.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#favicon ⇒ Object
Returns the value of attribute favicon.
-
#images ⇒ Object
Returns the value of attribute images.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#videos ⇒ Object
Returns the value of attribute videos.
Instance Method Summary collapse
- #as_json ⇒ Object
- #image=(image) ⇒ Object
-
#initialize ⇒ Website
constructor
A new instance of Website.
- #video=(video) ⇒ Object
Methods inherited from LinkThumbnailer::Model
Constructor Details
#initialize ⇒ Website
Returns a new instance of Website.
11 12 13 14 |
# File 'lib/link_thumbnailer/models/website.rb', line 11 def initialize @images = [] @videos = [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def description @description end |
#favicon ⇒ Object
Returns the value of attribute favicon.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def favicon @favicon end |
#images ⇒ Object
Returns the value of attribute images.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def images @images end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def url @url end |
#videos ⇒ Object
Returns the value of attribute videos.
9 10 11 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def videos @videos end |
Instance Method Details
#as_json ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/link_thumbnailer/models/website.rb', line 41 def as_json(*) { url: url.to_s, favicon: favicon, title: title, description: description, images: images.map(&:as_json), videos: videos.map(&:as_json) } end |
#image=(image) ⇒ Object
26 27 28 |
# File 'lib/link_thumbnailer/models/website.rb', line 26 def image=(image) self.images = image end |
#video=(video) ⇒ Object
16 17 18 |
# File 'lib/link_thumbnailer/models/website.rb', line 16 def video=(video) self.videos = video end |