Class: Philologic::Client::Collocation

Inherits:
Response
  • Object
show all
Defined in:
lib/philologic-client/collocation.rb

Overview

Philologic collocation table.

Extends Philologic::Client::Response

Defined Under Namespace

Classes: Row

Instance Attribute Summary collapse

Attributes inherited from Response

#client

Instance Method Summary collapse

Methods inherited from Response

#[], #each, #keys

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

#resultsObject (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?

Returns:

  • (Boolean)


33
34
35
# File 'lib/philologic-client/collocation.rb', line 33

def results?
  @results.size > 0 ? true : false
end