Sha256: 29ce5384f556b89793420d61f2974cd5ae08ccebc2f247b1eb49790fec05a5f1

Contents?: true

Size: 1.09 KB

Versions: 18

Compression:

Stored size: 1.09 KB

Contents

module Xsys
  module Model
    class Shop
      def self.attr_list
        [:id, :code, :name, :stock_description, :commercial,
        :virtual, :stockable, :has_target, :service, :physical_shop_code,
        :position, :has_stock_control, :has_exhibition, :stock_sellable,
        :stock_sellable, :enabled, :physical_shop_id, :last_update]
      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 service?
        service == true
      end

      def has_target?
        has_target == true
      end

      def has_exhibition?
        has_exhibition == 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

18 entries across 18 versions & 1 rubygems

Version Path
xsys-0.11.1 lib/xsys/model/shop.rb
xsys-0.10.4 lib/xsys/model/shop.rb
xsys-0.10.3 lib/xsys/model/shop.rb
xsys-0.10.2 lib/xsys/model/shop.rb
xsys-0.10.1 lib/xsys/model/shop.rb
xsys-0.10.0 lib/xsys/model/shop.rb
xsys-0.9.2 lib/xsys/model/shop.rb
xsys-0.9.1 lib/xsys/model/shop.rb
xsys-0.9.0 lib/xsys/model/shop.rb
xsys-0.8.7 lib/xsys/model/shop.rb
xsys-0.8.6 lib/xsys/model/shop.rb
xsys-0.8.5 lib/xsys/model/shop.rb
xsys-0.8.4 lib/xsys/model/shop.rb
xsys-0.8.3 lib/xsys/model/shop.rb
xsys-0.8.2 lib/xsys/model/shop.rb
xsys-0.8.1 lib/xsys/model/shop.rb
xsys-0.8.0 lib/xsys/model/shop.rb
xsys-0.7.0 lib/xsys/model/shop.rb