Class: RequestType::Validator
  
  
  
Overview
  
    
A request type validator belongs to a request type, and is responsible for validating a single request option request_option => The option that will be validated valid_options => A serialized object that responds to include? Returning true if the option is present  It should also return an array of valid options in response to to_a
   
 
  
Defined Under Namespace
  
    
  
    
      Classes: ArrayWithDefault, FlowcellTypeValidator, LibraryTypeValidator, NullValidator
    
  
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
  
  
  
  
  
  
  
  
  Methods included from Squishify
  extended
  
  
  
    Instance Method Details
    
      
  
  
    #allow_blank?  ⇒ Boolean 
  
  
  
  
    | 
127
128
129
130
131 | # File 'app/models/request_type/validator.rb', line 127
def allow_blank?
  return false unless valid_options.respond_to? :allow_blank?
  valid_options.allow_blank?
end | 
 
    
      
  
  
    #default  ⇒ Object 
  
  
  
  
    | 
119
120
121 | # File 'app/models/request_type/validator.rb', line 119
def default
  valid_options.respond_to?(:default) ? valid_options.default : nil
end | 
 
    
      
  
  
    #options  ⇒ Object 
  
  
  
  
    | 
115
116
117 | # File 'app/models/request_type/validator.rb', line 115
def options
  valid_options.to_a
end | 
 
    
      
  
  
    #type_cast  ⇒ Object 
  
  
  
  
    | 
123
124
125 | # File 'app/models/request_type/validator.rb', line 123
def type_cast
  { 'read_length' => :to_i, 'insert_size' => :to_i }[request_option]
end | 
 
    
      
  
  
    #validate?(value)  ⇒ Boolean 
  
  
  
  
    | 
111
112
113 | # File 'app/models/request_type/validator.rb', line 111
def validate?(value)
  valid_options.include?(value)
end |