lib/csl/style/number.rb in csl-1.0.0.pre8 vs lib/csl/style/number.rb in csl-1.0.0.pre9
- old
+ new
@@ -13,31 +13,38 @@
def variable
attributes[:variable]
end
+ def has_form?
+ attribute?(:form)
+ end
+
+ def form
+ attributes[:form]
+ end
+
# @return [Boolean] whether or not the number's format is set to
# :numeric; also returns true if the number's form attribute is not
# set or nil.
def numeric?
- !attribute?(:form) || attributes.form.to_sym == :numeric
+ !has_form? || form.to_sym == :numeric
end
# @return [Boolean] whether or not the number's format is set to :ordinal
def ordinal?
- attribute?(:form) && attributes.form.to_sym == :ordinal
+ has_form? && form.to_sym == :ordinal
end
# @return [Boolean] whether or not the number's format is set to :'long-ordinal'
def long_ordinal?
- attribute?(:form) && attributes.form.to_sym == :'long-ordinal'
+ has_form? && form.to_sym == :'long-ordinal'
end
# @return [Boolean] whether or not the number's format is set to :roman
def roman?
- attribute?(:form) && attributes.form.to_sym == :roman
+ has_form? && form.to_sym == :roman
end
-
end
end
end
\ No newline at end of file