Method: Argos::Ascii.factory
- Defined in:
- lib/argos/ascii.rb
.factory(type) ⇒ Argos::Ds Argos::Diag
Factory for Argos::Ds / Argos::Diag
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/argos/ascii.rb', line 47 def self.factory(type) # Auto-detect file format if not "ds" or "diag" if not ["ds","diag"].include? type if argos? type type = self.type(type) end end case type when "ds" Ds.new when "diag" Diag.new else raise ArgumentError, "Unknown Argos type: #{type}" end end |