class CSL::Style
Attributes
Public Class Methods
Source
# File lib/csl/style.rb, line 20 def load(input = nil) super(input || Style.default) end
Calls superclass method
CSL::Loader#load
Source
# File lib/csl/style.rb, line 52 def initialize(attributes = {}) super(attributes, &nil) children[:locale], children[:macro], @macros, @errors = [], [], {}, [] yield self if block_given? end
Calls superclass method
CSL::Node::new
Public Instance Methods
Source
# File lib/csl/style.rb, line 60 def added_child(node) delegate = :"added_#{node.nodename}" send delegate, node if respond_to?(delegate, true) node end
@override
Source
# File lib/csl/style.rb, line 67 def deleted_child(node) delegate = :"deleted_#{node.nodename}" send delegate, node if respond_to?(delegate, true) node end
@override
Source
# File lib/csl/style.rb, line 119 def demote_non_dropping_particle attributes[:'demote-non-dropping-particle'] end
Also aliased as: demote_particle
Source
# File lib/csl/style.rb, line 124 def demote_non_dropping_particle? attribute?(:'demote-non-dropping-particle') end
Also aliased as: demote_particle?
Source
# File lib/csl/style.rb, line 133 def has_page_range_format? attribute?(:'page-range-format') end
Source
# File lib/csl/style.rb, line 89 def id return unless info.has_id? info.id.to_s end
@return [String] the style’s id
Source
# File lib/csl/style.rb, line 114 def independent_parent return unless dependent? load_related_style_from independent_parent_link end
Source
# File lib/csl/style.rb, line 129 def initialize_without_hyphen? attribute?(:'initialize-with-hyphen') && !attributes[:'initialize-with-hyphen'] end
Source
# File lib/csl/style.rb, line 137 def page_range_format attributes[:'page-range-format'] end
Source
# File lib/csl/style.rb, line 103 def template return unless has_template? load_related_style_from template_link end
@return [Style] the style’s template
Source
# File lib/csl/style.rb, line 95 def title return unless info.has_title? info.title.to_s end
@return [String] the style’s title
Private Instance Methods
Source
# File lib/csl/style.rb, line 153 def added_macro(node) unless node.attribute?(:name) raise ValidationError, "failed to register macro #{node.inspect}: name attribute missing" end if macros.key?(node[:name]) raise ValidationError, "failed to register macro #{node.inspect}: duplicate name" end macros[node[:name]] = node end
Source
# File lib/csl/style.rb, line 167 def deleted_macro(node) macros.delete node[:name] end