Class: ChemSpider::ExtRef

Inherits:
Object
  • Object
show all
Defined in:
lib/chem_spider/services/search.rb

Constant Summary collapse

ATTRIBUTES =
{
  :csid => {
    :selector => 'CSID',
    :datatype => Integer,
    :first_child => true,
  },
  :ds_name => {
    :selector => 'ds_name',
    :datatype => String,
    :first_child => true,
  },
  :ds_url => {
    :selector => 'ds_url',
    :datatype => URI,
    :first_child => true,
  },
  :ext_id => {
    :selector => 'ext_id',
    :datatype => String,
    :first_child => true,
  },
  :ext_url => {
    :selector => 'ext_url',
    :datatype => URI,
    :first_child => true,
  },
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ExtRef

Returns a new instance of ExtRef.



78
79
80
81
82
# File 'lib/chem_spider/services/search.rb', line 78

def initialize(attributes = {})
  ATTRIBUTES.keys.each do |attr_name|
    instance_variable_set(:"@#{attr_name}", attributes[attr_name])
  end
end

Class Method Details

.__attributes__Object



71
72
73
# File 'lib/chem_spider/services/search.rb', line 71

def __attributes__
  ATTRIBUTES
end