Class: Person

Inherits:
Object
  • Object
show all
Defined in:
sample/c++sample.rb

Defined Under Namespace

Modules: Core

Instance Method Summary collapse

Constructor Details

#initialize(name, age) ⇒ Person

Returns a new instance of Person.



33
34
35
36
# File 'sample/c++sample.rb', line 33

def initialize(name, age)
  @ptr = Core::Data.alloc
  Core::__6PersonPCci(@ptr, name, age)
end

Instance Method Details

#get_ageObject



47
48
49
# File 'sample/c++sample.rb', line 47

def get_age()
  Core::get_age__6Person(@ptr)
end

#get_nameObject



38
39
40
41
42
43
44
45
# File 'sample/c++sample.rb', line 38

def get_name()
  str = Core::get_name__6Person(@ptr)
  if( str )
    str.to_s
  else
    nil
  end
end

#set_age(age) ⇒ Object



51
52
53
# File 'sample/c++sample.rb', line 51

def set_age(age)
  Core::set_age__6Personi(@ptr, age)
end