Sha256: 62cef0a5ac1b1f98d0891f9ec728de56671675a68bbfde976665b85144d95537

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

# coding: utf-8

module Thinreports
  module Core::Shape

    class List::Store < ::Struct
      include Utils

      def self.init(attrs)
        new(attrs).new
      end

      def self.new(attrs)
        super(*attrs.keys) do
          @default_values = attrs.values

          def self.default_values
            deep_copy(@default_values)
          end
        end
      end

      def initialize
        super(*self.class.default_values)
      end

      def copy
        self.class.new
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinreports-0.8.2 lib/thinreports/core/shape/list/store.rb
thinreports-0.8.1 lib/thinreports/core/shape/list/store.rb
thinreports-0.8.0 lib/thinreports/core/shape/list/store.rb