Class: Musa::GenerativeGrammar::OptionElement

Inherits:
Object
  • Object
show all
Defined in:
lib/musa-dsl/generative/generative-grammar.rb

Overview

Container for generated option elements.

Wraps content and attributes for each element in a generated option. Used internally when generating grammar options.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, attributes = nil) ⇒ OptionElement

Creates option element.

Parameters:

  • content (Object)

    element content

  • attributes (Hash, nil) (defaults to: nil)

    element attributes



169
170
171
172
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 169

def initialize(content, attributes = nil)
  @content = content
  @attributes = attributes || {}
end

Instance Attribute Details

#attributesHash (readonly)

element attributes

Returns:

  • (Hash)

    the current value of attributes



162
163
164
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 162

def attributes
  @attributes
end

#contentObject (readonly)

element content

Returns:

  • (Object)

    the current value of content



162
163
164
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 162

def content
  @content
end