class OysterDb::Table
This will model a table containing oyster data for the day
Attributes
date[R]
oysters[RW]
Public Class Methods
new(date)
click to toggle source
This will create a new table given the date Will create an empty array to hold oyster objects
# File lib/OysterDb.rb, line 50 def initialize(date) @date = date @oysters = [] end
Public Instance Methods
add_oyster(oyster)
click to toggle source
Allows an oyster to be added to the table
# File lib/OysterDb.rb, line 61 def add_oyster(oyster) @oysters.push(oyster) end
get_count()
click to toggle source
Returns total number of oysters in table
# File lib/OysterDb.rb, line 56 def get_count return @oysters.count end