Module: Chemicalml::Cml::Base::Reaction

Defined in:
lib/chemicalml/cml/base/reaction.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/chemicalml/cml/base/reaction.rb', line 7

def self.included(klass)
  klass.class_eval do
    include Chemicalml::Cml::Role::Reaction
    attribute :id, :string
    attribute :title, :string
    attribute :type, :string
    attribute :state, :string
    attribute :reactant_list, :reactantList
    attribute :product_list, :productList

    xml do
    namespace Chemicalml::Cml::Namespace
      root "reaction"
      map_attribute "id", to: :id
      map_attribute "title", to: :title
      map_attribute "type", to: :type
      map_attribute "state", to: :state
      map_element "reactantList", to: :reactant_list
      map_element "productList", to: :product_list
    end
  end
end