Class: OysterDb::Oyster
- Inherits:
-
Object
- Object
- OysterDb::Oyster
- Defined in:
- lib/OysterDb.rb
Overview
Models a single oyster
Instance Attribute Summary collapse
-
#grade ⇒ Object
readonly
This will produce read methods for all the oyster properties.
-
#height ⇒ Object
readonly
This will produce read methods for all the oyster properties.
-
#id ⇒ Object
readonly
This will produce read methods for all the oyster properties.
-
#length ⇒ Object
readonly
This will produce read methods for all the oyster properties.
-
#volume ⇒ Object
readonly
This will produce read methods for all the oyster properties.
-
#width ⇒ Object
readonly
This will produce read methods for all the oyster properties.
Instance Method Summary collapse
-
#initialize(data_hash) ⇒ Oyster
constructor
Will create a new oyster object given a hash with all the data.
Constructor Details
#initialize(data_hash) ⇒ Oyster
Will create a new oyster object given a hash with all the data
11 12 13 14 15 16 17 18 |
# File 'lib/OysterDb.rb', line 11 def initialize(data_hash) @id = data_hash["id"] @grade = data_hash["grade"] @volume = data_hash["volume"] @length = data_hash["length"] @width = data_hash["width"] @height = data_hash["height"] end |
Instance Attribute Details
#grade ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def grade @grade end |
#height ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def height @height end |
#id ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def id @id end |
#length ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def length @length end |
#volume ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def volume @volume end |
#width ⇒ Object (readonly)
This will produce read methods for all the oyster properties
9 10 11 |
# File 'lib/OysterDb.rb', line 9 def width @width end |