Module: ActiveDelegate::ReadWrite

Defined in:
lib/active_delegate/read_write.rb

Class Method Summary collapse

Class Method Details

.method_suffixesObject

Get method suffixes



12
13
14
# File 'lib/active_delegate/read_write.rb', line 12

def method_suffixes
  ['', '=', '?']
end

.readwrite_methods(attributes) ⇒ Object

Get readwrite methods for attributes



5
6
7
8
9
# File 'lib/active_delegate/read_write.rb', line 5

def readwrite_methods(attributes)
  @readwrite_methods = attributes.to_a.flat_map do |attribute|
    method_suffixes.map { |suffix| "#{attribute}#{suffix}" }
  end
end