class Taxonifi::Model::AuthorYear

A class to aggregate People and Year combinations.

Attributes

parens[RW]

The parens attribute reflects that this combinations was cited in parentheses.

people[RW]

Array of Taxonifi::Model::People

year[RW]

String

Public Class Methods

new(options = {}) click to toggle source
# File lib/models/author_year.rb, line 15
def initialize(options = {})
  opts = {
    :people => [],
    :parens => false,
    :year => nil
  }.merge!(options)

  @parens = opts[:parens] 
  @people = opts[:people] 
  @year = opts[:year] 
end

Public Instance Methods

compact_index() click to toggle source

Return a string representing all data, used in indexing.

# File lib/models/author_year.rb, line 28
def compact_index
  index = [@year]
  @people.each do |a|
    index.push a.compact_string
  end
  index.join("-")
end