lib/csl/style/label.rb in csl-1.0.0.pre7 vs lib/csl/style/label.rb in csl-1.0.0.pre8

- old
+ new

@@ -1,14 +1,38 @@ module CSL class Style - + class Label < Node - + + attr_struct :variable, :form, :plural, + *Schema.attr(:formatting, :periods) + has_no_children - - attr_struct :variable, :form, :plural, :'text-case', - *Schema.attr(:affixes, :font, :periods) - + + def has_variable? + attribute?(:variable) + end + + def variable + attributes[:variable] + end + + def locator? + variable.to_s =~ /^locator$/i + end + + def page? + variable.to_s =~ /^page$/i + end + + def always_pluralize? + attributes[:plural].to_s =~ /^always$/i + end + + def never_pluralize? + attributes[:plural].to_s =~ /^never$/i + end + end - + end end \ No newline at end of file