Class: Class

Inherits:
Object show all
Defined in:
lib/muflax/objects.rb

Overview

make it possible to track data in attributes

Instance Method Summary collapse

Instance Method Details

#attr_accessor(*names) ⇒ Object



29
30
31
32
33
# File 'lib/muflax/objects.rb', line 29

def attr_accessor(*names)
  attr_readers.concat(names)
  attr_writers.concat(names)
  attr_accessor_without_tracking(*names)
end

#attr_accessor_without_trackingObject



28
# File 'lib/muflax/objects.rb', line 28

alias_method :attr_accessor_without_tracking, :attr_accessor

#attr_reader(*names) ⇒ Object



9
10
11
12
# File 'lib/muflax/objects.rb', line 9

def attr_reader(*names)
  attr_readers.concat(names)
  attr_reader_without_tracking(*names)
end

#attr_reader_without_trackingObject



8
# File 'lib/muflax/objects.rb', line 8

alias_method :attr_reader_without_tracking, :attr_reader

#attr_readersObject



14
15
16
# File 'lib/muflax/objects.rb', line 14

def attr_readers
  @attr_readers ||= [ ]
end

#attr_writer(*names) ⇒ Object



19
20
21
22
# File 'lib/muflax/objects.rb', line 19

def attr_writer(*names)
  attr_writers.concat(names)
  attr_writer_without_tracking(*names)
end

#attr_writer_without_trackingObject



18
# File 'lib/muflax/objects.rb', line 18

alias_method :attr_writer_without_tracking, :attr_writer

#attr_writersObject



24
25
26
# File 'lib/muflax/objects.rb', line 24

def attr_writers
  @attr_writers ||= [ ]
end

#attributesObject



35
36
37
# File 'lib/muflax/objects.rb', line 35

def attributes
  attr_readers + attr_writers
end