Sha256: f0a08b9743fedc582a1186777b0ff1ce7f614df09eee2f9c3aedb06d46b087cf

Contents?: true

Size: 1.24 KB

Versions: 55

Compression:

Stored size: 1.24 KB

Contents

module Vedeu

  module Repositories

    module DSL

      class ModelTestClass

        include Vedeu::DSL
        include Vedeu::DSL::Presentation

        protected

        attr_reader :model

      end # DSL

    end # ModelTestClass

    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::Repositories::Model
      include Vedeu::Presentation

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

      def initialize(attributes = {})
        defaults.merge!(attributes).each do |key, value|
          instance_variable_set("@#{key}", value)
        end
      end

      private

      # Returns the default options/attributes for this class.
      #
      def defaults
        {
          colour:     {},
          name:       '',
          repository: Vedeu::Repositories::RepositoryTestModule,
          style:      [],
        }
      end

    end # ModelTestClass

  end # Repositories

end # Vedeu

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
vedeu-0.6.56 test/support/helpers/model_test_class.rb
vedeu-0.6.54 test/support/helpers/model_test_class.rb
vedeu-0.6.53 test/support/helpers/model_test_class.rb
vedeu-0.6.52 test/support/helpers/model_test_class.rb
vedeu-0.6.51 test/support/helpers/model_test_class.rb
vedeu-0.6.50 test/support/helpers/model_test_class.rb
vedeu-0.6.49 test/support/helpers/model_test_class.rb
vedeu-0.6.48 test/support/helpers/model_test_class.rb
vedeu-0.6.47 test/support/helpers/model_test_class.rb
vedeu-0.6.46 test/support/helpers/model_test_class.rb
vedeu-0.6.45 test/support/helpers/model_test_class.rb
vedeu-0.6.44 test/support/helpers/model_test_class.rb
vedeu-0.6.43 test/support/helpers/model_test_class.rb
vedeu-0.6.42 test/support/helpers/model_test_class.rb
vedeu-0.6.41 test/support/helpers/model_test_class.rb
vedeu-0.6.40 test/support/helpers/model_test_class.rb
vedeu-0.6.39 test/support/helpers/model_test_class.rb
vedeu-0.6.38 test/support/helpers/model_test_class.rb
vedeu-0.6.37 test/support/helpers/model_test_class.rb
vedeu-0.6.36 test/support/helpers/model_test_class.rb