Sha256: 5f2b972e73d3bc9dfec6d795571c9f0dd9b511553e108067b1c270244d2191c8

Contents?: true

Size: 937 Bytes

Versions: 13

Compression:

Stored size: 937 Bytes

Contents

# frozen_string_literal: true
require_relative "./representer/product_group"

module ONEAccess
  module DataObject
    class ProductGroup
      extend Serializable

      represented_by Representer::ProductGroup

      attr_accessor :id
      attr_accessor :name
      attr_accessor :description
      attr_accessor :status
      attr_accessor :contributor_org_id
      attr_accessor :type
      attr_accessor :is_default

      alias is_default? is_default
      alias default? is_default

      def active?
        status == ProductGroupStatus::ACTIVE
      end

      def inactive?
        status == ProductGroupStatus::INACTIVE
      end

      def research?
        type == ProductType::RESEARCH
      end

      def private_events?
        type == ProductType::PRIVATE_EVENT
      end

      def events?
        type == ProductType::EVENT
      end

      def models?
        type == ProductType::MODEL
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
oneaccess-0.4.4 lib/oneaccess/data_object/product_group.rb
oneaccess-0.4.3 lib/oneaccess/data_object/product_group.rb
oneaccess-0.4.2 lib/oneaccess/data_object/product_group.rb
oneaccess-0.4.1 lib/oneaccess/data_object/product_group.rb
oneaccess-0.4.0 lib/oneaccess/data_object/product_group.rb
oneaccess-0.3.0 lib/oneaccess/data_object/product_group.rb
oneaccess-0.2.0 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.9 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.8 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.7 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.6 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.5 lib/oneaccess/data_object/product_group.rb
oneaccess-0.1.4 lib/oneaccess/data_object/product_group.rb