Class: CSL::Style
- Extended by:
- Loader
- Defined in:
- lib/csl/style.rb,
lib/csl/style/date.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, 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
-
#id ⇒ String
The style’s id.
- #independent? ⇒ Boolean
- #independent_parent ⇒ Object
- #info ⇒ Object
-
#initialize(attributes = {}) {|_self| ... } ⇒ Style
constructor
A new instance of Style.
-
#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 inherited from Node
#<=>, #attribute?, #attributes?, #attributes_for, constantize, create, create_attributes, #custom_attributes, #deep_copy, #default_attribute?, default_attributes, #default_attributes, #each, #exact_match?, #formatting_options, #has_attributes?, #has_default_attributes?, #has_language?, hide_default_attributes!, hide_default_attributes?, #initialize_copy, #inspect, #match?, match?, matches?, parse, parse!, #save_to, show_default_attributes!, #tags, #textnode?, types
Methods included from PrettyPrinter
Methods included from Treelike
#<<, #add_child, #add_children, #ancestors, #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.
51 52 53 54 55 56 |
# File 'lib/csl/style.rb', line 51 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.
16 17 18 |
# File 'lib/csl/style.rb', line 16 def default @default end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
35 36 37 |
# File 'lib/csl/style.rb', line 35 def errors @errors end |
#macros ⇒ Object (readonly)
Returns the value of attribute macros.
35 36 37 |
# File 'lib/csl/style.rb', line 35 def macros @macros end |
Class Method Details
Instance Method Details
#added_child(node) ⇒ Object
59 60 61 62 63 |
# File 'lib/csl/style.rb', line 59 def added_child(node) delegate = :"added_#{node.nodename}" send delegate, node if respond_to?(delegate, true) node end |
#deleted_child(node) ⇒ Object
66 67 68 69 70 |
# File 'lib/csl/style.rb', line 66 def deleted_child(node) delegate = :"deleted_#{node.nodename}" send delegate, node if respond_to?(delegate, true) node end |
#id ⇒ String
Returns the style’s id.
87 88 89 90 |
# File 'lib/csl/style.rb', line 87 def id return unless info.has_id? info.id.to_s end |
#independent? ⇒ Boolean
108 109 110 |
# File 'lib/csl/style.rb', line 108 def independent? !dependent? end |
#independent_parent ⇒ Object
112 113 114 115 |
# File 'lib/csl/style.rb', line 112 def independent_parent return unless dependent? independent_parent_link end |
#info ⇒ Object
80 81 82 |
# File 'lib/csl/style.rb', line 80 def info children[:info] ||= Info.new end |
#template ⇒ Style
Returns the style’s template.
101 102 103 104 |
# File 'lib/csl/style.rb', line 101 def template return unless has_template? template_link end |
#title ⇒ String
Returns the style’s title.
93 94 95 96 |
# File 'lib/csl/style.rb', line 93 def title return unless info.has_title? info.title.to_s end |
#valid? ⇒ Boolean
76 77 78 |
# File 'lib/csl/style.rb', line 76 def valid? validate.empty? end |