<=>(other)
click to toggle source
Calls superclass method
def <=>(other)
other.respond_to?(:to_a) ? to_a <=> other.to_a : super
end
add(name)
click to toggle source
def add(name)
case
when name.is_a?(Name)
@tokens << name
when name.respond_to?(:to_s)
@tokens += Names.parse(name.to_s)
else
raise ArgumentError, "failed to add #{name.inspect}: not a name."
end
self
end
atomic?()
click to toggle source
join()
click to toggle source
name?()
click to toggle source
numeric?()
click to toggle source
replace(*arguments)
click to toggle source
def replace(*arguments)
self
end
strip_braces()
click to toggle source
def strip_braces
gsub!(/\{|\}/,'')
end
to_citeproc(options = {})
click to toggle source
def to_citeproc(options = {})
map { |n| n.to_citeproc(options) }
end
to_name()
click to toggle source
to_s(options = {})
click to toggle source
def to_s(options = {})
return value unless options.has_key?(:quotes)
q = [options[:quotes]].flatten
[q[0], value, q[-1]].compact.join
end
value(options = {})
click to toggle source
def value(options = {})
@tokens.map { |n| n.to_s(options) }.join(' and ')
end