Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/cinch/rubyext/module.rb

Instance Method Summary collapse

Instance Method Details

#synced_attr_accessor(attr) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
# File 'lib/cinch/rubyext/module.rb', line 14

def synced_attr_accessor(attr)
  synced_attr_reader(attr)
  attr_accessor(attr)
end

#synced_attr_reader(attribute) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3
4
5
6
7
8
9
10
11
# File 'lib/cinch/rubyext/module.rb', line 3

def synced_attr_reader(attribute)
  define_method(attribute) do
    attr(attribute)
  end

  define_method("#{attribute}_unsynced") do
    attr(attribute, false, true)
  end
end