Class: LinkThumbnailer::Models::Description
- Inherits:
-
LinkThumbnailer::Model
- Object
- LinkThumbnailer::Model
- LinkThumbnailer::Models::Description
- Defined in:
- lib/link_thumbnailer/models/description.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#score ⇒ Object
Returns the value of attribute score.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(node, text, position = 1) ⇒ Description
constructor
A new instance of Description.
- #to_s ⇒ Object
Methods inherited from LinkThumbnailer::Model
Constructor Details
#initialize(node, text, position = 1) ⇒ Description
Returns a new instance of Description.
11 12 13 14 15 16 |
# File 'lib/link_thumbnailer/models/description.rb', line 11 def initialize(node, text, position = 1) @node = node @text = sanitize(text) @position = position @score = compute_score end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
8 9 10 |
# File 'lib/link_thumbnailer/models/description.rb', line 8 def node @node end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
8 9 10 |
# File 'lib/link_thumbnailer/models/description.rb', line 8 def position @position end |
#score ⇒ Object
Returns the value of attribute score.
9 10 11 |
# File 'lib/link_thumbnailer/models/description.rb', line 9 def score @score end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/link_thumbnailer/models/description.rb', line 8 def text @text end |
Instance Method Details
#<=>(other) ⇒ Object
22 23 24 |
# File 'lib/link_thumbnailer/models/description.rb', line 22 def <=>(other) score <=> other.score end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/link_thumbnailer/models/description.rb', line 18 def to_s text end |