Sha256: 0bc7815d9e98c75f2f72da5770bf8bcf19802cc551e801b7a90ef70b8aed0d3b

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

require "private_attr/version"

module PrivateAttr
  module_function

  def private_attr_accessor *attr
    private_attr_reader(*attr)
    private_attr_writer(*attr)
  end

  def private_attr_reader *attr
    attr_reader(*attr)
    private(*attr)
  end

  def private_attr_writer *attr
    attr_writer(*attr)
    private(*attr.map { |a| "#{a}=" })
  end

  def protected_attr_accessor *attr
    protected_attr_reader(*attr)
    protected_attr_writer(*attr)
  end

  def protected_attr_reader *attr
    attr_reader(*attr)
    protected(*attr)
  end

  def protected_attr_writer *attr
    attr_writer(*attr)
    protected(*attr.map { |a| "#{a}=" })
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
private_attr-1.1.0 lib/private_attr.rb
private_attr-1.0.0 lib/private_attr.rb