Sha256: 82413dadc58b4f057d5d74fedf6ef0bfdfb7be9a6bb342ba297475f040428596

Contents?: true

Size: 406 Bytes

Versions: 5

Compression:

Stored size: 406 Bytes

Contents

require 'extensions/hash'

module Moblues
  module DataModel
    class Entity < Struct.new(:name, :parent_entity, :attributes, :relationships)
      def initialize(params)
        p = params.compact
        super(
          p.fetch(:name),
          p.fetch(:parent_entity, 'NSManagedObject'),
          p.fetch(:attributes, []),
          p.fetch(:relationships, [])
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
moblues-0.4.0 lib/moblues/data_model/entity.rb
moblues-0.3.0 lib/moblues/data_model/entity.rb
moblues-0.2.0 lib/moblues/data_model/entity.rb
moblues-0.1.0 lib/moblues/data_model/entity.rb
moblues-0.0.1 lib/moblues/data_model/entity.rb