Module: PrivateAttrAccessor

Included in:
Backend
Defined in:
app/helpers/private_attr_accessor.rb

Overview

Private attribute accessors

Instance Method Summary collapse

Instance Method Details

#private_attr_accessor(*names) ⇒ Object

Defines attribute accessors in a private context

Parameters:

  • names (Array)

    attribute names as symbols


6
7
8
9
# File 'app/helpers/private_attr_accessor.rb', line 6

def private_attr_accessor(*names)
  private
  attr_accessor *names
end

#private_attr_reader(*names) ⇒ Object

Defines attribute readers in a private context

Parameters:

  • names (Array)

    attribute names as symbols


14
15
16
17
# File 'app/helpers/private_attr_accessor.rb', line 14

def private_attr_reader(*names)
  private
  attr_reader *names
end

#private_attr_writer(*names) ⇒ Object

Defines attribute writers in a private context

Parameters:

  • names (Array)

    attribute names as symbols


22
23
24
25
# File 'app/helpers/private_attr_accessor.rb', line 22

def private_attr_writer(*names)
  private
  attr_writer *names
end