class OysterDb::Oyster
Models a single oyster
Attributes
grade[R]
This will produce read methods for all the oyster properties
height[R]
This will produce read methods for all the oyster properties
id[R]
This will produce read methods for all the oyster properties
length[R]
This will produce read methods for all the oyster properties
volume[R]
This will produce read methods for all the oyster properties
width[R]
This will produce read methods for all the oyster properties
Public Class Methods
new(data_hash)
click to toggle source
Will create a new oyster object given a hash with all the data Paramaters should include Grade, Volume, Width, Length, Height, Id
# File lib/OysterDb.rb, line 12 def initialize(data_hash) @id = data_hash["id"] if data_hash["Grade"] @grade = data_hash["Grade"] else @grade = "No grade recorded" end if data_hash["Volume"] @volume = data_hash["Volume"] else @volume = "No volume recorded" end if data_hash["Length"] @length = data_hash["Length"] else @length = "No length recoreded" end if data_hash["Width"] @width = data_hash["Width"] else @width = "No width recorded" end if data_hash["Height"] @height = data_hash["Height"] else @height = "No height recorded" end end