class Biblioref
Attributes
edit_num[RW]
p_date[RW]
p_house[RW]
p_place[RW]
title_[RW]
volume[RW]
Public Class Methods
new(params = {})
click to toggle source
# File lib/dsl/references.rb, line 13 def initialize(params = {}) self.author_name = [] self.author_surname = [] end
Public Instance Methods
<=>(another)
click to toggle source
# File lib/dsl/references.rb, line 33 def <=> (another) if (self.author_surname != another.author_surname) self.author_surname<=>another.author_surname elsif (self.author_surname == another.author_surname && self.p_date!=another.p_date) self.author_surname<=>another.author_surname self.p_date<=>another.p_date end end
to_s()
click to toggle source
# File lib/dsl/references.rb, line 19 def to_s fullnames = "" i=0 while i < self.author_name.count if i != self.author_name.count-1 fullnames= fullnames + "#{self.author_surname[i]}, #{self.author_name[i][0]}. & " else fullnames= fullnames + "#{self.author_surname[i]}, #{self.author_name[i][0]}." end i=i+1 end "#{fullnames} (#{self.p_date}). #{self.title_} (#{self.edit_num}) (#{self.volume}). #{self.p_place}: #{self.p_house}." end