Sha256: c127bc9ef8ecd75bcdea5e31e12a7aa2ce527b6b248fd301a7cbbfb7f2f84ea9

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

module Zermelo
  module Records

    class Key

      # id       / if nil, it's a class variable
      # object   / :association, :attribute or :index
      # accessor / if a complex type, some way of getting sub-value
      attr_reader :klass, :id, :name, :accessor, :type, :object

      # TODO better validation of data, e.g. accessor valid for type, etc.
      def initialize(opts = {})
        [:klass, :id, :name, :accessor, :type, :object].each do |iv|
          instance_variable_set("@#{iv}", opts[iv])
        end
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zermelo-1.1.0 lib/zermelo/records/key.rb