Module: Agrippa::AccessorMethods

Included in:
Immutable::ClassMethods, Mutable::ClassMethods, MutableHash::ClassMethods
Defined in:
lib/agrippa/accessor_methods.rb

Instance Method Summary collapse

Instance Method Details

#state_accessor(*args) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/agrippa/accessor_methods.rb', line 19

def state_accessor(*args)
    options = args.last.is_a?(Hash) ? args.pop : {}
    args.flatten.each do |arg|
        __define_state_reader(arg, caller, options)
        __define_state_writer(arg, caller, options)
    end
    self
end

#state_reader(*args) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/agrippa/accessor_methods.rb', line 3

def state_reader(*args)
    options = args.last.is_a?(Hash) ? args.pop : {}
    args.flatten.each do |arg|
        __define_state_reader(arg, caller, options)
    end
    self
end

#state_writer(*args) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/agrippa/accessor_methods.rb', line 11

def state_writer(*args)
    options = args.last.is_a?(Hash) ? args.pop : {}
    args.flatten.each do |arg|
        __define_state_writer(arg, caller, options)
    end
    self
end