Class: Minfraud::Components::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/minfraud/components/base.rb

Overview

This is a parent class for all components. It defines a method which is used for basic JSON representation of the component objects.

Instance Method Summary collapse

Instance Method Details

#to_json(*_args) ⇒ Hash

A JSON representation of component attributes.

Returns:

  • (Hash)


11
12
13
# File 'lib/minfraud/components/base.rb', line 11

def to_json(*_args)
  instance_variables.reduce({}) { |mem, e| populate!(mem, e) }
end