Class: CSL::Style::Names

Inherits:
Node show all
Defined in:
lib/csl/style/names.rb

Instance Attribute Summary

Attributes inherited from Node

#attributes

Attributes included from Treelike

#children, #nodename, #parent

Instance Method Summary collapse

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

#pretty_print, #tags, #to_xml

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| ... } ⇒ Names

Returns a new instance of Names.

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
# File 'lib/csl/style/names.rb', line 12

def initialize(attributes = {})
  super(attributes)
  children[:label] = []

  yield self if block_given?
end

Instance Method Details

#delimiterObject



19
20
21
# File 'lib/csl/style/names.rb', line 19

def delimiter
  attributes.fetch(:delimiter, '')
end

#has_variable?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/csl/style/names.rb', line 23

def has_variable?
  attribute?(:variable)
end

#variableObject



27
28
29
# File 'lib/csl/style/names.rb', line 27

def variable
  attributes[:variable].to_s
end