Class: LinkThumbnailer::Models::Title
- Inherits:
-
LinkThumbnailer::Model
- Object
- LinkThumbnailer::Model
- LinkThumbnailer::Models::Title
- Defined in:
- lib/link_thumbnailer/models/title.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(node, text = nil) ⇒ Title
constructor
A new instance of Title.
- #to_s ⇒ Object
Methods inherited from LinkThumbnailer::Model
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
#node ⇒ Object (readonly)
Returns the value of attribute node.
7 8 9 |
# File 'lib/link_thumbnailer/models/title.rb', line 7 def node @node end |
#text ⇒ Object (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_s ⇒ Object
14 15 16 |
# File 'lib/link_thumbnailer/models/title.rb', line 14 def to_s text end |