Sha256: 01006f16977cdb993e50bc088e2d4075dc7fc6d76cd251eed2adadc3e43114e6

Contents?: true

Size: 964 Bytes

Versions: 21

Compression:

Stored size: 964 Bytes

Contents

require 'vedeu/repositories/model'
require 'vedeu/output/presentation'

module Vedeu

  module RepositoryTestModule

    extend self

    def by_name(name)
      model
    end

    # The real repository stores the model and returns it.
    def store(model)
      model
    end

    private

    # A storage solution that uses memory to persist models.
    def in_memory
      {}
    end

  end # RepositoryTestModule

  class ModelTestClass

    include Vedeu::Model
    include Vedeu::Presentation

    attr_accessor :background, :colour, :name, :style

    def initialize(attributes = {})
      @attributes = defaults.merge!(attributes)

      @colour = @attributes[:colour]
      @name       = @attributes[:name]
      @style      = @attributes[:style]
      @repository = Vedeu::RepositoryTestModule
    end

    private

    def defaults
      {
        colour: {},
        name:   '',
        style:  [],
      }
    end

  end # ModelTestClass

end # Vedeu

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vedeu-0.4.39 test/support/helpers/model_test_class.rb
vedeu-0.4.38 test/support/helpers/model_test_class.rb
vedeu-0.4.37 test/support/helpers/model_test_class.rb
vedeu-0.4.36 test/support/helpers/model_test_class.rb
vedeu-0.4.35 test/support/helpers/model_test_class.rb
vedeu-0.4.34 test/support/helpers/model_test_class.rb
vedeu-0.4.33 test/support/helpers/model_test_class.rb
vedeu-0.4.32 test/support/helpers/model_test_class.rb
vedeu-0.4.31 test/support/helpers/model_test_class.rb
vedeu-0.4.30 test/support/helpers/model_test_class.rb
vedeu-0.4.29 test/support/helpers/model_test_class.rb
vedeu-0.4.28 test/support/helpers/model_test_class.rb
vedeu-0.4.27 test/support/helpers/model_test_class.rb
vedeu-0.4.26 test/support/helpers/model_test_class.rb
vedeu-0.4.25 test/support/helpers/model_test_class.rb
vedeu-0.4.24 test/support/helpers/model_test_class.rb
vedeu-0.4.23 test/support/helpers/model_test_class.rb
vedeu-0.4.22 test/support/helpers/model_test_class.rb
vedeu-0.4.21 test/support/helpers/model_test_class.rb
vedeu-0.4.20 test/support/helpers/model_test_class.rb