Class: ODDB::Remote::Drugs::ActiveAgent
- Inherits:
-
Object
- Object
- Object
- ODDB::Remote::Drugs::ActiveAgent
show all
- Defined in:
- lib/oddb/remote/drugs/active_agent.rb
Instance Attribute Summary
Attributes inherited from Object
#remote, #source
Instance Method Summary
collapse
Methods inherited from Object
delegate, #initialize, #uid
Instance Method Details
#<=>(other) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/oddb/remote/drugs/active_agent.rb', line 17
def <=>(other)
if(dose.nil?)
substance <=> other.substance
else
[substance, dose] <=> [other.substance, other.dose]
end
end
|
11
12
13
|
# File 'lib/oddb/remote/drugs/active_agent.rb', line 11
def dose
@dose ||= @remote.dose
end
|
#substance ⇒ Object
14
15
16
|
# File 'lib/oddb/remote/drugs/active_agent.rb', line 14
def substance
@substance ||= Remote::Drugs::Substance.new(@source, @remote.substance)
end
|