Class: ODDB::Drugs::Ddd
Constant Summary
Constants included from OddbUri
Instance Attribute Summary collapse
-
#administration ⇒ Object
readonly
Returns the value of attribute administration.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#dose ⇒ Object
Returns the value of attribute dose.
Instance Method Summary collapse
-
#initialize(administration) ⇒ Ddd
constructor
A new instance of Ddd.
- #to_s ⇒ Object
Methods inherited from Model
#__odba_delete__, #__odba_save__, _serializables, belongs_to, connections, connector, connectors, #data_origin, #data_origins, delegates, #delete, find_by_uid, has_many, is_coded, m10l_document, multilingual, #odba_serializables, #oid, on_delete, on_save, predicates, #save, #saved?, serializables, serialize, singular
Methods included from ODBA::Persistable
Methods included from Yaml
append_features, #to_yaml_properties
Methods included from OddbUri
#to_yaml, #to_yaml_map, #to_yaml_type
Constructor Details
#initialize(administration) ⇒ Ddd
Returns a new instance of Ddd.
12 13 14 |
# File 'lib/oddb/drugs/ddd.rb', line 12 def initialize(administration) @administration = administration end |
Instance Attribute Details
#administration ⇒ Object (readonly)
Returns the value of attribute administration.
9 10 11 |
# File 'lib/oddb/drugs/ddd.rb', line 9 def administration @administration end |
#comment ⇒ Object
Returns the value of attribute comment.
10 11 12 |
# File 'lib/oddb/drugs/ddd.rb', line 10 def comment @comment end |
#dose ⇒ Object
Returns the value of attribute dose.
10 11 12 |
# File 'lib/oddb/drugs/ddd.rb', line 10 def dose @dose end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/oddb/drugs/ddd.rb', line 15 def to_s if(@comment) sprintf("%s: %s (%s)", @administration, @dose, @comment) else sprintf("%s: %s", @administration, @dose) end end |