Class: BEL::Nanopub::ExperimentContext

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/bel/nanopub/experiment_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values = []) ⇒ ExperimentContext

Returns a new instance of ExperimentContext.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bel/nanopub/experiment_context.rb', line 12

def initialize(values = [])
  @values = values.map { |item|
    name  = item[:name]  || item['name']
    value = item[:value] || item['value']
    {
      :name  => name.to_sym,
      :value => value
    }
  }
  @values.sort_by! { |item| item[:name] }
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



7
8
9
# File 'lib/bel/nanopub/experiment_context.rb', line 7

def values
  @values
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



24
25
26
27
# File 'lib/bel/nanopub/experiment_context.rb', line 24

def ==(other)
  return false if other.nil?
  @values == other.values
end