Class: BEL::Nanopub::ExperimentContext
- Inherits:
-
Object
- Object
- BEL::Nanopub::ExperimentContext
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/bel/nanopub/experiment_context.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(values = []) ⇒ ExperimentContext
constructor
A new instance of ExperimentContext.
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
#values ⇒ Object
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 |