lib/csl/style/names.rb in csl-1.0.0.pre13 vs lib/csl/style/names.rb in csl-1.0.0.pre14

- old
+ new

@@ -1,28 +1,36 @@ module CSL class Style - + class Names < Node - - attr_struct :variable, *Schema.attr(:names, :delimiter, :affixes, :display, :font) - + + attr_struct :variable, *Schema.attr(:names, :delimiter, :affixes, :display, :font) + attr_children :name, :'et-al', :label, :substitute - + alias labels label - + def initialize(attributes = {}) super(attributes) children[:label] = [] - + yield self if block_given? end - + + def has_variable? + attribute?(:variable) + end + + def variable + attributes[:variable] + end + end - - + + class Name < Node - + attr_struct :form, *Schema.attr(:name, :affixes, :font, :delimiter) attr_children :'name-part' alias parts name_part @@ -31,24 +39,24 @@ super(attributes) children[:'name-part'] = [] yield self if block_given? end - + end class NamePart < Node has_no_children attr_struct :name, :'text-case', *Schema.attr(:affixes, :font) end - + class EtAl < Node has_no_children attr_struct :term, *Schema.attr(:affixes, :font) end class Substitute < Node end - - + + end end \ No newline at end of file