Class: PubChemAPI::ProteinSummary

Inherits:
APIResponse show all
Defined in:
lib/pubchem_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ProteinSummary

Returns a new instance of ProteinSummary.



120
121
122
123
124
125
126
127
# File 'lib/pubchem_api.rb', line 120

def initialize(data)
  super(data)
  protein = data['InformationList']['Information'].first
  @accession = protein['Accession']
  @name = protein['Title']
  @taxonomy_id = protein['TaxId']
  @synonyms = protein['Synonym']
end

Instance Attribute Details

#accessionObject (readonly)

Returns the value of attribute accession.



118
119
120
# File 'lib/pubchem_api.rb', line 118

def accession
  @accession
end

#nameObject (readonly)

Returns the value of attribute name.



118
119
120
# File 'lib/pubchem_api.rb', line 118

def name
  @name
end

#synonymsObject (readonly)

Returns the value of attribute synonyms.



118
119
120
# File 'lib/pubchem_api.rb', line 118

def synonyms
  @synonyms
end

#taxonomy_idObject (readonly)

Returns the value of attribute taxonomy_id.



118
119
120
# File 'lib/pubchem_api.rb', line 118

def taxonomy_id
  @taxonomy_id
end