Sha256: 17fd253089c8cdf630623c9bd4b33afc84109d5484eb670d32486ddff6073e2d

Contents?: true

Size: 945 Bytes

Versions: 44

Compression:

Stored size: 945 Bytes

Contents

module Xsys
  module Model
    class Shop
      def self.attr_list
        [:id, :code, :name, :commercial, :virtual, :stockable, :has_target,
         :position, :has_stock_control, :stock_sellable, :enabled, :kind]
      end

      attr_reader *attr_list

      def initialize(attributes={})
        attributes.each do |k, v|
          self.send("#{k}=", v) if self.respond_to?(k)
        end
      end

      def commercial?
        commercial == true
      end

      def virtual?
        virtual == true
      end

      def physical?
        !virtual?
      end

      def stockable?
        stockable == true
      end

      def has_target?
        has_target == true
      end

      def has_stock_control?
        has_stock_control == true
      end

      def stock_sellable?
        stock_sellable == true
      end

      def enabled?
        enabled == true
      end

      private

      attr_writer *attr_list
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
xsys-0.47.0 lib/xsys/model/shop.rb
xsys-0.46.0 lib/xsys/model/shop.rb
xsys-0.45.0 lib/xsys/model/shop.rb
xsys-0.44.0 lib/xsys/model/shop.rb
xsys-0.43.0 lib/xsys/model/shop.rb
xsys-0.42.0 lib/xsys/model/shop.rb
xsys-0.41.0 lib/xsys/model/shop.rb
xsys-0.40.0 lib/xsys/model/shop.rb
xsys-0.39.0 lib/xsys/model/shop.rb
xsys-0.38.0 lib/xsys/model/shop.rb
xsys-0.37.0 lib/xsys/model/shop.rb
xsys-0.36.0 lib/xsys/model/shop.rb
xsys-0.35.0 lib/xsys/model/shop.rb
xsys-0.34.0 lib/xsys/model/shop.rb
xsys-0.33.0 lib/xsys/model/shop.rb
xsys-0.32.0 lib/xsys/model/shop.rb
xsys-0.31.0 lib/xsys/model/shop.rb
xsys-0.30.0 lib/xsys/model/shop.rb
xsys-0.28.0 lib/xsys/model/shop.rb
xsys-0.27.0 lib/xsys/model/shop.rb