module Ruspider::MassSpecAPI

MassSpec API: www.chemspider.com/MassSpecAPI.asmx

Constants

API
FIELDS

Public Class Methods

new(rest) click to toggle source
# File lib/ruspider/mass_spec_api.rb, line 27
def initialize(rest)
  @rest = rest
end

Public Instance Methods

databases() click to toggle source
# File lib/ruspider/mass_spec_api.rb, line 31
def databases
  response = @rest.post(API, 'GetDatabases')
  array_from_xml(response, 'ArrayOfString', 'string')
end
get_extended_compound_info(csid) click to toggle source
# File lib/ruspider/mass_spec_api.rb, line 36
def get_extended_compound_info(csid)
  response = @rest.post(API, 'GetExtendedCompoundInfo', csid: csid)
  hash_from_string(response, 'ExtendedCompoundInfo', FIELDS)
end
get_extended_compound_info_list(csids) click to toggle source
# File lib/ruspider/mass_spec_api.rb, line 41
def get_extended_compound_info_list(csids)
  response = @rest.post(API, 'GetExtendedCompoundInfoArray', csids: csids)
  nodes = get_nodes(response)
  nodes.map { |node| hash_from_xml(node, FIELDS) }
end