Method: RDF::Format.to_sym

Defined in:
lib/rdf/format.rb

.to_symSymbol

Note:

Defaults to the last element of the class name before ‘Format` downcased and made a symbol. Individual formats can override this.

Returns a symbol appropriate to use with ‘RDF::Format.for()`

Returns:

  • (Symbol)


314
315
316
317
318
319
# File 'lib/rdf/format.rb', line 314

def self.to_sym
  elements = self.to_s.split("::")
  sym = elements.pop
  sym = elements.pop if sym == 'Format'
  sym.downcase.to_s.to_sym if sym.is_a?(String)
end