Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/jrubyfx/core_ext/observable_value.rb

Instance Method Summary collapse

Instance Method Details

#property_accessor(*symbol_names) ⇒ Object


149
150
151
152
153
154
155
156
157
# File 'lib/jrubyfx/core_ext/observable_value.rb', line 149

def property_accessor(*symbol_names)
  property_reader *symbol_names
  property_writer *symbol_names
  symbol_names.each do |symbol_name|
    send(:define_method, symbol_name.id2name + "_property") do
      instance_variable_get("@#{symbol_name}")
    end
  end
end

#property_reader(*symbol_names) ⇒ Object


142
143
144
145
146
147
148
# File 'lib/jrubyfx/core_ext/observable_value.rb', line 142

def property_reader(*symbol_names)
  symbol_names.each do |symbol_name|
    send(:define_method, symbol_name.id2name) do
      instance_variable_get("@#{symbol_name}").getValue
    end
  end
end

#property_writer(*symbol_names) ⇒ Object


135
136
137
138
139
140
141
# File 'lib/jrubyfx/core_ext/observable_value.rb', line 135

def property_writer(*symbol_names)
  symbol_names.each do |symbol_name|
    send(:define_method, symbol_name.id2name + "=") do |val|
      instance_variable_get("@#{symbol_name}").setValue val
    end
  end
end