Class: RedactedData

Inherits:
Data
  • Object
show all
Includes:
Redactable
Defined in:
lib/redacted_data.rb

Overview

rubocop:disable Style/Documentation rubocop:disable Style/MultilineIfModifier A subclass of Data that redacts members by default, and can allow some to be printed

Class Method Summary collapse

Methods included from Redactable

#allowed_members, #base_name_for_inspection, #base_type_for_pp, included, #inspect, #pretty_print

Class Method Details

.define(*members, allowed_members: [], &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/redacted_data.rb', line 9

def self.define(*members, allowed_members: [], &block)
  super(*members, &block).tap do |data_class|
    data_class.class_eval do
      @allowed_members = Array(allowed_members)
    end
  end
end