Class: Bioinform::YAMLCollectionParser
- Includes:
- MultipleMotifsParser
- Defined in:
- lib/bioinform/parsers/yaml_parser.rb
Instance Attribute Summary
Attributes inherited from Parser
Instance Method Summary collapse
- #collection ⇒ Object
- 
  
    
      #initialize(input)  ⇒ YAMLCollectionParser 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of YAMLCollectionParser. 
- #parse! ⇒ Object
Methods inherited from Parser
array_from_acgt_hash, choose, need_tranpose?, normalize_hash_keys, parse, #parse, parse!, transform_input, try_convert_to_array, valid_matrix?
Methods included from Parser::SingleMotifParser
Constructor Details
#initialize(input) ⇒ YAMLCollectionParser
Returns a new instance of YAMLCollectionParser.
| 23 24 25 | # File 'lib/bioinform/parsers/yaml_parser.rb', line 23 def initialize(input) @input = input end | 
Instance Method Details
#collection ⇒ Object
| 26 27 28 | # File 'lib/bioinform/parsers/yaml_parser.rb', line 26 def collection @collection ||= YAML.load(input) end | 
#parse! ⇒ Object
| 29 30 31 32 33 | # File 'lib/bioinform/parsers/yaml_parser.rb', line 29 def parse! collection.container.shift.pm rescue Psych::SyntaxError raise 'parsing error' end |