Class: Module

Inherits:
Object show all
Defined in:
lib/origen/core_ext/module.rb

Instance Method Summary collapse

Instance Method Details

#alias_accessor(new, orig) ⇒ Object



2
3
4
5
# File 'lib/origen/core_ext/module.rb', line 2

def alias_accessor(new, orig)
  alias_reader(new, orig)
  alias_writer(new, orig)
end

#alias_reader(new, orig) ⇒ Object



11
12
13
# File 'lib/origen/core_ext/module.rb', line 11

def alias_reader(new, orig)
  alias_method(new, orig) if method_defined?(orig)
end

#alias_writer(new, orig) ⇒ Object



7
8
9
# File 'lib/origen/core_ext/module.rb', line 7

def alias_writer(new, orig)
  alias_method("#{new}=", "#{orig}=") if method_defined?("#{orig}=")
end