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) ⇒ void

Creates option element.

Parameters:

  • content (Object) —

    element content

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

    element attributes



178
179
180
181
# File 'lib/musa-dsl/generative/generative-grammar.rb', line 178

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

Instance Attribute Details

#attributes ⇒ Hash (readonly)

element attributes

Returns:

  • (Hash) —

    the current value of attributes



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

def attributes
  @attributes
end

#content ⇒ Object (readonly)

element content

Returns:

  • (Object) —

    the current value of content



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

def content
  @content
end