Class: Philologic::Client::Collocation
- Defined in:
- lib/philologic-client/collocation.rb
Overview
Philologic collocation table.
Extends Philologic::Client::Response
Defined Under Namespace
Classes: Row
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Get
Array
of Philologic::Client::CollocationRow objects.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(document, client = nil) ⇒ Collocation
constructor
Initialize Philologic::Client::Collocation object.
-
#results? ⇒ Boolean
Does this collocation table contain results?.
Methods inherited from Response
Constructor Details
#initialize(document, client = nil) ⇒ Collocation
Initialize Philologic::Client::Collocation object.
Params:
document
-
Nokogiri document
client
-
(optional) Philologic::Client object or
nil
24 25 26 27 28 |
# File 'lib/philologic-client/collocation.rb', line 24 def initialize(document, client = nil) super @results = @doc.css('tr.colloc_row').collect { |tr| Row.new(tr) } end |
Instance Attribute Details
#results ⇒ Object (readonly)
Get Array
of Philologic::Client::CollocationRow objects
15 16 17 |
# File 'lib/philologic-client/collocation.rb', line 15 def results @results end |
Instance Method Details
#results? ⇒ Boolean
Does this collocation table contain results?
33 34 35 |
# File 'lib/philologic-client/collocation.rb', line 33 def results? @results.size > 0 ? true : false end |