Module: Kilza::Language

Included in:
Java, Objc
Defined in:
lib/kilza/language.rb

Overview

Represents an program language

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_nameObject

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

Parameters:

  • base_name (String)

    First class name

Returns:

  • (Array)

    All available classes



8
9
10
# File 'lib/kilza/language.rb', line 8

def classes
  @classes
end

#equal_keysObject

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_stringObject

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_delimiterObject

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_wordsObject

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

#typesObject

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