Class: Gitara::Node::Alternative

Inherits:
Base
  • Object
show all
Defined in:
lib/gitara/node/alternative.rb

Instance Attribute Summary

Attributes inherited from Base

#$1

Instance Method Summary collapse

Methods inherited from Base

#add, #ancestor, #children=, #chorded, #definition, #definition?, #definition_children, #definition_name, #definition_of?, #definitions, #descendants, #id, #id_as_word, #inspect, #name, #stanza_version, #value, #voiced_as

Instance Method Details

#call_value(node_version) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/gitara/node/alternative.rb', line 4

def call_value(node_version)
  alternatives = node_version.definition_children.map do |child|
    "{ #{child.call_value} }"
  end

  "\\alternative { #{alternatives.join(' ')} }"
end