Class: Philologic::Client::Collocation::Row
- Inherits:
-
Object
- Object
- Philologic::Client::Collocation::Row
- Defined in:
- lib/philologic-client/collocation.rb
Overview
Row within a collocation table.
Instance Attribute Summary collapse
-
#left_value ⇒ Object
readonly
Get value or
0
. -
#left_word ⇒ Object
readonly
Get left word or
nil
. -
#right_value ⇒ Object
readonly
Get value or
0
. -
#right_word ⇒ Object
readonly
Get right word or
nil
. -
#value ⇒ Object
readonly
Get value or
0
. -
#word ⇒ Object
readonly
Get word or
nil
.
Instance Method Summary collapse
-
#initialize(document = nil) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(document = nil) ⇒ Row
Returns a new instance of Row.
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/philologic-client/collocation.rb', line 68 def initialize(document = nil) both = document.css('td.colloc_both_value').first @word = both.css('span.colloc_label').text @value = both.css('span.colloc_value').text.to_i left = document.css('td.colloc_left_value').first @left_word = left.css('a.colloc_label').text @left_value = left.css('span.colloc_value').text.to_i right= document.css('td.colloc_right_value').first @right_word = right.css('a.colloc_label').text @right_value = right.css('span.colloc_value').text.to_i end |
Instance Attribute Details
#left_value ⇒ Object (readonly)
Get value or 0
54 55 56 |
# File 'lib/philologic-client/collocation.rb', line 54 def left_value @left_value end |
#left_word ⇒ Object (readonly)
Get left word or nil
58 59 60 |
# File 'lib/philologic-client/collocation.rb', line 58 def left_word @left_word end |
#right_value ⇒ Object (readonly)
Get value or 0
62 63 64 |
# File 'lib/philologic-client/collocation.rb', line 62 def right_value @right_value end |
#right_word ⇒ Object (readonly)
Get right word or nil
66 67 68 |
# File 'lib/philologic-client/collocation.rb', line 66 def right_word @right_word end |
#value ⇒ Object (readonly)
Get value or 0
46 47 48 |
# File 'lib/philologic-client/collocation.rb', line 46 def value @value end |
#word ⇒ Object (readonly)
Get word or nil
50 51 52 |
# File 'lib/philologic-client/collocation.rb', line 50 def word @word end |