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.7.4 test/support/helpers/model_test_class.rb
vedeu-0.7.3 test/support/helpers/model_test_class.rb
vedeu-0.7.2 test/support/helpers/model_test_class.rb
vedeu-0.7.1 test/support/helpers/model_test_class.rb
vedeu-0.7.0 test/support/helpers/model_test_class.rb
vedeu-0.6.71 test/support/helpers/model_test_class.rb
vedeu-0.6.70 test/support/helpers/model_test_class.rb
vedeu-0.6.69 test/support/helpers/model_test_class.rb
vedeu-0.6.68 test/support/helpers/model_test_class.rb
vedeu-0.6.67 test/support/helpers/model_test_class.rb
vedeu-0.6.66 test/support/helpers/model_test_class.rb
vedeu-0.6.65 test/support/helpers/model_test_class.rb
vedeu-0.6.64 test/support/helpers/model_test_class.rb
vedeu-0.6.63 test/support/helpers/model_test_class.rb
vedeu-0.6.62 test/support/helpers/model_test_class.rb
vedeu-0.6.61 test/support/helpers/model_test_class.rb
vedeu-0.6.60 test/support/helpers/model_test_class.rb
vedeu-0.6.59 test/support/helpers/model_test_class.rb
vedeu-0.6.58 test/support/helpers/model_test_class.rb
vedeu-0.6.57 test/support/helpers/model_test_class.rb