Class: AsciiChem::Model::Identifier

Inherits:
Struct
  • Object
show all
Defined in:
lib/asciichem/model/identifier.rb

Overview

A molecule identifier. Maps to CML <identifier> element. Carries the identifier value plus convention (e.g. "inchi", "smiles", "cas") and optional dict_ref.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conventionObject

Returns the value of attribute convention

Returns:

  • (Object)

    the current value of convention



8
9
10
# File 'lib/asciichem/model/identifier.rb', line 8

def convention
  @convention
end

#dict_refObject

Returns the value of attribute dict_ref

Returns:

  • (Object)

    the current value of dict_ref



8
9
10
# File 'lib/asciichem/model/identifier.rb', line 8

def dict_ref
  @dict_ref
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



8
9
10
# File 'lib/asciichem/model/identifier.rb', line 8

def value
  @value
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/asciichem/model/identifier.rb', line 9

def to_s
  "#{convention}:#{value}"
end