Class: Minfraud::Components::Base

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

Overview

Note:

This class is used as a parent class for all other components

Note:

It defines a method which is used for basic JSON representation of PORO objects

Instance Method Summary collapse

Instance Method Details

#to_jsonHash

Returns a JSON representation of component attributes.

Returns:

  • (Hash)

    a JSON representation of component attributes



7
8
9
# File 'lib/minfraud/components/base.rb', line 7

def to_json
  instance_variables.inject({}) { |mem, e| populate!(mem, e) }
end