class CSL::Style::Sort::Key

Public Instance Methods

ascending!() click to toggle source
# File lib/csl/style/sort.rb, line 46
def ascending!
  attributes[:sort] = 'ascending'
end
ascending?() click to toggle source
# File lib/csl/style/sort.rb, line 42
def ascending?
  attributes[:sort] =~ /^ascending$/i
end
descending!() click to toggle source
# File lib/csl/style/sort.rb, line 54
def descending!
  attributes[:sort] = 'descending'
end
descending?() click to toggle source
# File lib/csl/style/sort.rb, line 50
def descending?
  !ascending?
end
macro() click to toggle source
# File lib/csl/style/sort.rb, line 62
def macro
  fail 'cannot resolve macro: not associated with style' unless
    !root? && root.respond_to?(:macros)

  root.macros[attributes[:macro].to_s]
end
macro?() click to toggle source
# File lib/csl/style/sort.rb, line 58
def macro?
  attribute? :macro
end
name_options() click to toggle source
# File lib/csl/style/sort.rb, line 27
def name_options
  options = {}

  options[:'et-al-min'] = options[:'et-al-subsequent-min'] =
    attributes[:'names-min'] if attribute? :'names-min'

  options[:'et-al-use-first'] = options[:'et-al-subsequent-use-first'] =
    attributes[:'names-use-first'] if attribute? :'names-use-first'

  options[:'et-al-use-last'] = options[:'et-al-subsequent-use-last'] =
    attributes[:'names-use-last'] if attribute? :'names-use-last'

  options
end
variable() click to toggle source
# File lib/csl/style/sort.rb, line 69
def variable
  attributes[:variable]
end