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.
9 10 11 12 |
# File 'lib/link_thumbnailer/models/website.rb', line 9 def initialize @images = [] @videos = [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def description @description end |
#favicon ⇒ Object
Returns the value of attribute favicon.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def favicon @favicon end |
#images ⇒ Object
Returns the value of attribute images.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def images @images end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def url @url end |
#videos ⇒ Object
Returns the value of attribute videos.
7 8 9 |
# File 'lib/link_thumbnailer/models/website.rb', line 7 def videos @videos end |
Instance Method Details
#as_json ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/link_thumbnailer/models/website.rb', line 39 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
24 25 26 |
# File 'lib/link_thumbnailer/models/website.rb', line 24 def image=(image) self.images = image end |
#video=(video) ⇒ Object
14 15 16 |
# File 'lib/link_thumbnailer/models/website.rb', line 14 def video=(video) self.videos = video end |