class Inferno::Entities::Entity
Public Class Methods
new(params, attributes)
click to toggle source
# File lib/inferno/entities/entity.rb, line 4 def initialize(params, attributes) attributes.each { |name| instance_variable_set("@#{name}", params[name]) } end
Public Instance Methods
to_hash()
click to toggle source
# File lib/inferno/entities/entity.rb, line 8 def to_hash self.class::ATTRIBUTES.each_with_object({}) do |attribute, hash| hash[attribute] = send(attribute) end.compact end