Class: LinkThumbnailer::Models::Title

Inherits:
LinkThumbnailer::Model show all
Defined in:
lib/link_thumbnailer/models/title.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LinkThumbnailer::Model

#to_json

Constructor Details

#initialize(node, text = nil) ⇒ Title

Returns a new instance of Title.



9
10
11
12
# File 'lib/link_thumbnailer/models/title.rb', line 9

def initialize(node, text = nil)
  @node = node
  @text = sanitize(text || node.text)
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



7
8
9
# File 'lib/link_thumbnailer/models/title.rb', line 7

def node
  @node
end

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/link_thumbnailer/models/title.rb', line 7

def text
  @text
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/link_thumbnailer/models/title.rb', line 14

def to_s
  text
end