Module: Jaspion::Kilza::Language

Included in:
Java, Objc, Swift
Defined in:
lib/jaspion/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



12
13
14
# File 'lib/jaspion/kilza/language.rb', line 12

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



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

def classes
  @classes
end

#equal_keysObject

Array with all properties that will be used to compare other objects



21
22
23
# File 'lib/jaspion/kilza/language.rb', line 21

def equal_keys
  @equal_keys
end

#json_stringObject

JSON that will be used to generate objects



15
16
17
# File 'lib/jaspion/kilza/language.rb', line 15

def json_string
  @json_string
end

#reserved_wordsObject

Words that will receive an undescore before property name



18
19
20
# File 'lib/jaspion/kilza/language.rb', line 18

def reserved_words
  @reserved_words
end

#typesObject

Hash table with all language types mapped to target language



24
25
26
# File 'lib/jaspion/kilza/language.rb', line 24

def types
  @types
end

Instance Method Details

#initialize(json_string) ⇒ Object

Initializes the language If json_string is not a Hash {}, it will surroud the json with { “base_name”} = json_string

Parameters:

  • json_string (String)

    JSON String



32
33
34
35
36
37
38
# File 'lib/jaspion/kilza/language.rb', line 32

def initialize(json_string)
  @json_string = json_string
  @classes = []
  @types = {}
  @reserved_words = []
  @equal_keys = []
end