Class: Generated::Grammar
- Inherits:
-
Object
- Object
- Generated::Grammar
- Defined in:
- lib/ruby_grammar_builder/generated/grammar.rb
Instance Attribute Summary collapse
-
#information ⇒ String
Information for contributers.
-
#name ⇒ String
The name of the grammar.
-
#other_properties ⇒ Hash
Other properties.
-
#patterns ⇒ PatternRule
Rules in initial scope.
-
#repository ⇒ Hash<String=>Rule>
The repository of rules.
-
#scope_name ⇒ String
The grammars scope.
-
#version ⇒ String
The version of the grammar.
Instance Method Summary collapse
Instance Attribute Details
#information ⇒ String
Returns information for contributers.
12 13 14 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 12 def information @information end |
#name ⇒ String
Returns The name of the grammar.
6 7 8 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 6 def name @name end |
#other_properties ⇒ Hash
Returns other properties.
18 19 20 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 18 def other_properties @other_properties end |
#patterns ⇒ PatternRule
Returns rules in initial scope.
14 15 16 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 14 def patterns @patterns end |
#repository ⇒ Hash<String=>Rule>
Returns the repository of rules.
16 17 18 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 16 def repository @repository end |
#scope_name ⇒ String
Returns The grammars scope.
8 9 10 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 8 def scope_name @scope_name end |
#version ⇒ String
Returns The version of the grammar.
10 11 12 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 10 def version @version end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ruby_grammar_builder/generated/grammar.rb', line 20 def to_h default = { "name" => @name, "scopeName" => @scope_name, "version" => @version, "information_for_contributors" => @information, "repository" => @repository.transform_values(&:to_h), } other_properties.merge(default).merge(@patterns.to_h) end |