lib/csl/style/label.rb in csl-1.0.0.pre23 vs lib/csl/style/label.rb in csl-1.0.0

- old
+ new

@@ -9,12 +9,12 @@ # # If the {Label} is the child of a {Names} node, the parent's variable # is used instead of the local attribute. class Label < Node - attr_struct :variable, :form, :plural, - *Schema.attr(:formatting, :periods) + attr_struct :variable, :form, :plural, :'strip-periods', + *Schema.attr(:formatting) has_no_children @variables = [:locator, :page].concat(Schema.variables[:number]).freeze @@ -55,14 +55,14 @@ variable.to_s =~ pattern end end def always_pluralize? - attributes[:plural].to_s =~ /^always$/i + attribute?(:plural) && attributes[:plural] =~ /^always$/i end def never_pluralize? - attributes[:plural].to_s =~ /^never$/i + attribute?(:plural) && attributes[:plural] =~ /^never$/i end # @return [Boolean] whether or not the {Label} is inside a {Names} node def names_label? parent.is_a?(Names) \ No newline at end of file