module ImmutableRecord

Constants

VERSION

Public Class Methods

new(*attributes) click to toggle source
# File lib/immutable_record.rb, line 4
def self.new (*attributes)
  unless attributes.all? { |attr| attr.is_a?(Symbol) }
    raise ArgumentError, "attributes should be symbols!"
  end

  Class.new(Value) do
    attr_reader(*attributes)
    const_set("ATTRIBUTES", attributes.dup.freeze)
  end
end