Module: Fino::PrettyInspectable

Included in:
AbTesting::Experiment, AbTesting::Variant, Setting
Defined in:
lib/fino/pretty_inspectable.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



4
5
6
7
8
9
10
# File 'lib/fino/pretty_inspectable.rb', line 4

def inspect
  attributes = inspectable_attributes.map do |key, value|
    "#{key}=#{value.inspect}"
  end

  "#<#{self.class.name} #{attributes.join(', ')}>"
end

#pretty_print(pp) ⇒ Object

rubocop:disable Metrics/MethodLength



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fino/pretty_inspectable.rb', line 12

def pretty_print(pp) # rubocop:disable Metrics/MethodLength
  pp.object_group(self) do
    pp.nest(1) do
      pp.breakable
      pp.seplist(inspectable_attributes, nil, :each) do |key, value|
        pp.group do
          pp.text key.to_s
          pp.text ": "
          pp.pp value
        end
      end
    end
  end
end