Class: Zemanta::Markup::Link
- Inherits:
-
Object
- Object
- Zemanta::Markup::Link
- Defined in:
- lib/zemanta/markup/link.rb,
lib/zemanta/markup/link/target.rb
Defined Under Namespace
Classes: Target
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#entity_type ⇒ Object
readonly
Returns the value of attribute entity_type.
-
#relevance ⇒ Object
readonly
Returns the value of attribute relevance.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #above?(relevance, confidence) ⇒ Boolean
-
#initialize(opts = {}) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(opts = {}) ⇒ Link
Returns a new instance of Link.
6 7 8 9 10 11 12 |
# File 'lib/zemanta/markup/link.rb', line 6 def initialize(opts = {}) @relevance = opts["relevance"] @confidence = opts["confidence"] @entity_type = opts["entity_type"] @target = opts["target"].map{ |opts| Target.new(opts) } @anchor = opts["anchor"] end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
4 5 6 |
# File 'lib/zemanta/markup/link.rb', line 4 def anchor @anchor end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
4 5 6 |
# File 'lib/zemanta/markup/link.rb', line 4 def confidence @confidence end |
#entity_type ⇒ Object (readonly)
Returns the value of attribute entity_type.
4 5 6 |
# File 'lib/zemanta/markup/link.rb', line 4 def entity_type @entity_type end |
#relevance ⇒ Object (readonly)
Returns the value of attribute relevance.
4 5 6 |
# File 'lib/zemanta/markup/link.rb', line 4 def relevance @relevance end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
4 5 6 |
# File 'lib/zemanta/markup/link.rb', line 4 def target @target end |
Instance Method Details
#above?(relevance, confidence) ⇒ Boolean
14 15 16 |
# File 'lib/zemanta/markup/link.rb', line 14 def above?(relevance, confidence) @relevance >= relevance and @confidence >= confidence end |