Class: PubChemAPI::AssayRecord

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ AssayRecord

Returns a new instance of AssayRecord.



63
64
65
66
67
68
69
70
71
# File 'lib/pubchem_api.rb', line 63

def initialize(data)
  super(data)
  assay_container = data['PC_AssayContainer'].first
  assay = assay_container['assay']
  descr = assay['descr']
  @aid = descr['aid']['id']
  @name = descr['name']
  @description = descr['description']
end

Instance Attribute Details

#aidObject (readonly)

Returns the value of attribute aid.



61
62
63
# File 'lib/pubchem_api.rb', line 61

def aid
  @aid
end

#descriptionObject (readonly)

Returns the value of attribute description.



61
62
63
# File 'lib/pubchem_api.rb', line 61

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



61
62
63
# File 'lib/pubchem_api.rb', line 61

def name
  @name
end