small rename

to avoid confusion with type.create_method
This commit is contained in:
Torsten Ruger 2016-12-17 00:21:12 +02:00
parent 1a224f904b
commit 782627ae79

View File

@ -48,7 +48,7 @@ module Arm
end end
end end
def self.create_method(name, &block) def self.def_method(name, &block)
self.class.send(:define_method, name , &block) self.class.send(:define_method, name , &block)
end end
@ -73,7 +73,7 @@ module Arm
# be overriden in subclasses # be overriden in subclasses
def self.define_instruction_one(inst , clazz , defaults = {} ) def self.define_instruction_one(inst , clazz , defaults = {} )
clazz = class_for(clazz) clazz = class_for(clazz)
create_method(inst) do |first , options = nil| def_method(inst) do |first , options = nil|
options = {} if options == nil options = {} if options == nil
options.merge defaults options.merge defaults
options[:opcode] = inst options[:opcode] = inst
@ -85,7 +85,7 @@ module Arm
# same for two args (left right, from to etc) # same for two args (left right, from to etc)
def self.define_instruction_two(inst , clazz , defaults = {} ) def self.define_instruction_two(inst , clazz , defaults = {} )
clazz = self.class_for(clazz) clazz = self.class_for(clazz)
create_method(inst) do |left ,right , options = nil| def_method(inst) do |left ,right , options = nil|
options = {} if options == nil options = {} if options == nil
options.merge defaults options.merge defaults
left = Register::RegisterValue.convert(left) left = Register::RegisterValue.convert(left)
@ -98,7 +98,7 @@ module Arm
# same for three args (result = left right,) # same for three args (result = left right,)
def self.define_instruction_three(inst , clazz , defaults = {} ) def self.define_instruction_three(inst , clazz , defaults = {} )
clazz = self.class_for(clazz) clazz = self.class_for(clazz)
create_method(inst) do |result , left ,right = nil , options = nil| def_method(inst) do |result , left ,right = nil , options = nil|
options = {} if options == nil options = {} if options == nil
options.merge defaults options.merge defaults
options[:opcode] = inst options[:opcode] = inst