Module: Kilza::Language
Overview
Represents an program language
Instance Attribute Summary collapse
-
#base_name ⇒ Object
Name used to represent the first generated class.
-
#classes(base_name) ⇒ Array
Returns all available classes.
-
#equal_keys ⇒ Object
Array with all properties that will be used to compare other objects.
-
#json_string ⇒ Object
JSON that will be used to generate objects.
-
#reserved_delimiter ⇒ Object
String that will be used to prefix reserved words.
-
#reserved_words ⇒ Object
Words that will receive an undescore before property name.
-
#types ⇒ Object
Hash table with all language types mapped to target language.
Instance Method Summary collapse
Instance Attribute Details
#base_name ⇒ Object
Name used to represent the first generated class
11 12 13 |
# File 'lib/kilza/language.rb', line 11 def base_name @base_name end |
#classes(base_name) ⇒ Array
Returns all available classes
8 9 10 |
# File 'lib/kilza/language.rb', line 8 def classes @classes end |
#equal_keys ⇒ Object
Array with all properties that will be used to compare other objects
23 24 25 |
# File 'lib/kilza/language.rb', line 23 def equal_keys @equal_keys end |
#json_string ⇒ Object
JSON that will be used to generate objects
14 15 16 |
# File 'lib/kilza/language.rb', line 14 def json_string @json_string end |
#reserved_delimiter ⇒ Object
String that will be used to prefix reserved words
17 18 19 |
# File 'lib/kilza/language.rb', line 17 def reserved_delimiter @reserved_delimiter end |
#reserved_words ⇒ Object
Words that will receive an undescore before property name
20 21 22 |
# File 'lib/kilza/language.rb', line 20 def reserved_words @reserved_words end |
#types ⇒ Object
Hash table with all language types mapped to target language
26 27 28 |
# File 'lib/kilza/language.rb', line 26 def types @types end |
Instance Method Details
#initialize(json_string) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/kilza/language.rb', line 28 def initialize(json_string) @json_string = json_string @classes = [] @types = {} @reserved_words = [] @reserved_delimiter = '_' @equal_keys = [] end |