Class: Gettc::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/gettc/types.rb

Direct Known Subclasses

TArray

Instance Method Summary collapse

Constructor Details

#initialize(is_object) ⇒ Type

Returns a new instance of Type.



14
15
16
# File 'lib/gettc/types.rb', line 14

def initialize(is_object)
  @is_object = is_object
end

Instance Method Details

#obj?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/gettc/types.rb', line 18

def obj?
  @is_object
end

#to_sObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gettc/types.rb', line 22

def to_s
  return "#{subtype}[]" if self.is_a?(TArray)

  case self
  when TInt
    "int"
  when TLong
    "long"
  when TFloat
    "float"
  when TDouble
    "double"
  when TChar
    "char"
  when TString
    "String"
  when TBoolean
    "boolean"
  else
    "unknown"
  end
end