Class: ODDB::Remote::Drugs::Part

Inherits:
Object
  • Object
show all
Defined in:
lib/oddb/remote/drugs/part.rb

Instance Attribute Summary

Attributes inherited from Object

#remote, #source

Instance Method Summary collapse

Methods inherited from Object

delegate, #initialize, #uid

Constructor Details

This class inherits a constructor from ODDB::Remote::Object

Instance Method Details

#comparable_sizeObject



11
12
13
# File 'lib/oddb/remote/drugs/part.rb', line 11

def comparable_size
  @comparable_size ||= @remote.comparable_size
end

#quantityObject



14
15
16
# File 'lib/oddb/remote/drugs/part.rb', line 14

def quantity
  nil
end

#unitObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/oddb/remote/drugs/part.rb', line 17

def unit
  @unit ||= begin
              cstr = if comform = @remote.commercial_form
                       comform.de
                     else
                       comparable_size.unit
                     end
              @unit = Remote::Drugs::Unit.new(@source, cstr)
            end
end