Class: CSL::Style
- Extended by:
- Loader
- Includes:
- InheritableNameOptions
- Defined in:
- lib/csl/style.rb,
lib/csl/style/date.rb,
lib/csl/style/sort.rb,
lib/csl/style/text.rb,
lib/csl/style/group.rb,
lib/csl/style/label.rb,
lib/csl/style/macro.rb,
lib/csl/style/names.rb,
lib/csl/style/choose.rb,
lib/csl/style/layout.rb,
lib/csl/style/number.rb,
lib/csl/style/citation.rb,
lib/csl/style/bibliography.rb
Defined Under Namespace
Classes: Bibliography, Choose, Citation, Date, DatePart, EtAl, Group, Label, Layout, Macro, Name, NamePart, Names, Number, Sort, Substitute, Text
Class Attribute Summary collapse
-
.default ⇒ Object
Returns the value of attribute default.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#macros ⇒ Object
readonly
Returns the value of attribute macros.
Attributes included from Loader
Attributes inherited from Node
Attributes included from Treelike
Class Method Summary collapse
Instance Method Summary collapse
- #added_child(node) ⇒ Object
- #deleted_child(node) ⇒ Object
- #demote_non_dropping_particle ⇒ Object (also: #demote_particle)
- #demote_non_dropping_particle? ⇒ Boolean (also: #demote_particle?)
- #has_page_range_format? ⇒ Boolean
-
#id ⇒ String
The style’s id.
- #independent? ⇒ Boolean
- #independent_parent ⇒ Object
- #info ⇒ Object
-
#initialize(attributes = {}) {|_self| ... } ⇒ Style
constructor
A new instance of Style.
- #initialize_without_hyphen? ⇒ Boolean
- #page_range_format ⇒ Object
-
#template ⇒ Style
The style’s template.
-
#title ⇒ String
The style’s title.
- #valid? ⇒ Boolean
- #validate ⇒ Object
Methods included from Loader
extend_name, extend_path, list, load
Methods included from InheritableNameOptions
#inheritable_name_options, #inheritable_names_options
Methods inherited from Node
#<=>, #attribute?, #attributes?, #attributes_for, constantize, create, create_attributes, #custom_attributes, #deep_copy, #default_attribute?, #default_attributes, default_attributes, #each, #exact_match?, #format_page_ranges?, #formatting_options, #has_attributes?, #has_default_attributes?, #has_language?, hide_default_attributes!, hide_default_attributes?, #initialize_copy, #inspect, match?, #match?, matches?, #merge!, parse, parse!, #quotes?, #reverse_merge!, #save_to, show_default_attributes!, #strip_periods?, #tags, #textnode?, types
Methods included from Extensions::Nesting
Methods included from PrettyPrinter
Methods included from Treelike
#<<, #add_child, #add_children, #ancestors, #closest, #delete_child, #delete_children, #depth, #descendants, #each_ancestor, #each_child, #each_descendant, #each_sibling, #empty?, #find_child, #find_children, #has_children?, #root, #root?, #siblings, #unlink
Constructor Details
#initialize(attributes = {}) {|_self| ... } ⇒ Style
Returns a new instance of Style.
52 53 54 55 56 57 |
# 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 |
Class Attribute Details
.default ⇒ Object
Returns the value of attribute default.
18 19 20 |
# File 'lib/csl/style.rb', line 18 def default @default end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
37 38 39 |
# File 'lib/csl/style.rb', line 37 def errors @errors end |
#macros ⇒ Object (readonly)
Returns the value of attribute macros.
37 38 39 |
# File 'lib/csl/style.rb', line 37 def macros @macros end |
Class Method Details
Instance Method Details
#added_child(node) ⇒ Object
60 61 62 63 64 |
# 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 |
#deleted_child(node) ⇒ Object
67 68 69 70 71 |
# 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 |
#demote_non_dropping_particle ⇒ Object Also known as: demote_particle
119 120 121 |
# File 'lib/csl/style.rb', line 119 def demote_non_dropping_particle attributes[:'demote-non-dropping-particle'] end |
#demote_non_dropping_particle? ⇒ Boolean Also known as: demote_particle?
124 125 126 |
# File 'lib/csl/style.rb', line 124 def demote_non_dropping_particle? attribute?(:'demote-non-dropping-particle') end |
#has_page_range_format? ⇒ Boolean
133 134 135 |
# File 'lib/csl/style.rb', line 133 def has_page_range_format? attribute?(:'page-range-format') end |
#id ⇒ String
Returns the style’s id.
89 90 91 92 |
# File 'lib/csl/style.rb', line 89 def id return unless info.has_id? info.id.to_s end |
#independent? ⇒ Boolean
110 111 112 |
# File 'lib/csl/style.rb', line 110 def independent? !dependent? end |
#independent_parent ⇒ Object
114 115 116 117 |
# File 'lib/csl/style.rb', line 114 def independent_parent return unless dependent? independent_parent_link end |
#info ⇒ Object
82 83 84 |
# File 'lib/csl/style.rb', line 82 def info children[:info] ||= Info.new end |
#initialize_without_hyphen? ⇒ Boolean
129 130 131 |
# File 'lib/csl/style.rb', line 129 def initialize_without_hyphen? attribute?(:'initialize-with-hyphen') && !attributes[:'initialize-with-hyphen'] end |
#page_range_format ⇒ Object
137 138 139 |
# File 'lib/csl/style.rb', line 137 def page_range_format attributes[:'page-range-format'] end |
#template ⇒ Style
Returns the style’s template.
103 104 105 106 |
# File 'lib/csl/style.rb', line 103 def template return unless has_template? template_link end |
#title ⇒ String
Returns the style’s title.
95 96 97 98 |
# File 'lib/csl/style.rb', line 95 def title return unless info.has_title? info.title.to_s end |
#valid? ⇒ Boolean
77 78 79 |
# File 'lib/csl/style.rb', line 77 def valid? validate.empty? end |