Class: GirFFI::Builder::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi/builder/property.rb

Overview

Creates property getter and setter code for a given IPropertyInfo.

Instance Method Summary collapse

Constructor Details

#initialize(property_info) ⇒ Property



5
6
7
# File 'lib/gir_ffi/builder/property.rb', line 5

def initialize property_info
  @info = property_info
end

Instance Method Details

#getter_defObject



9
10
11
12
13
14
15
# File 'lib/gir_ffi/builder/property.rb', line 9

def getter_def
  return "  def \#{@info.getter_name}\n    get_property \"\#{@info.name}\"\n  end\n  CODE\nend\n"

#setter_defObject



17
18
19
20
21
22
23
# File 'lib/gir_ffi/builder/property.rb', line 17

def setter_def
  return "  def \#{@info.getter_name}= value\n    set_property \"\#{@info.name}\", value\n  end\n  CODE\nend\n"