Module: SampleManifest::CoreBehaviour

Included in:
SampleManifest
Defined in:
app/models/sample_manifest/core_behaviour.rb

Defined Under Namespace

Modules: LibraryAssets, NoSpecializedValidation, Shared, StockAssets

Constant Summary collapse

BEHAVIOURS =
%w[1dtube plate multiplexed_library library library_plate tube_rack].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



81
82
83
84
85
86
87
88
89
# File 'app/models/sample_manifest/core_behaviour.rb', line 81

def self.included(base)
  base.class_eval do
    delegate :details, :details_array, :validate_specialized_fields, :specialized_fields, to: :core_behaviour

    def self.supported_asset_type?(asset_type)
      asset_type.nil? || BEHAVIOURS.include?(asset_type)
    end
  end
end

Instance Method Details

#core_behaviourObject



91
92
93
# File 'app/models/sample_manifest/core_behaviour.rb', line 91

def core_behaviour
  @core_behaviour ||= "::SampleManifest::#{behaviour_module}::Core".constantize.new(self)
end