Class: Philologic::Client::Concordance
- Defined in:
- lib/philologic-client/concordance.rb
Overview
Philologic concordance search results.
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Get
Array
of Philologic::Client::Occurrence objects.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(document, client = nil) ⇒ Concordance
constructor
Initialize Philologic::Client::Concordance object.
-
#results? ⇒ Boolean
Were any results found?.
Methods inherited from Response
Constructor Details
#initialize(document, client = nil) ⇒ Concordance
Initialize Philologic::Client::Concordance object.
Params:
document
-
Nokogiri document
client
-
(optional) Philologic::Client object or
nil
22 23 24 25 26 |
# File 'lib/philologic-client/concordance.rb', line 22 def initialize(document, client = nil) super @results = @doc.css('li.philologic_occurrence').collect { |o| Philologic::Client::Occurrence.new(o, client) } end |
Instance Attribute Details
#results ⇒ Object (readonly)
Get Array
of Philologic::Client::Occurrence objects
13 14 15 |
# File 'lib/philologic-client/concordance.rb', line 13 def results @results end |
Instance Method Details
#results? ⇒ Boolean
Were any results found?
31 32 33 |
# File 'lib/philologic-client/concordance.rb', line 31 def results? @results.size > 0 ? true : false end |