Created
September 10, 2014 04:52
-
-
Save qrprat77/ad76a460d2d309863afa to your computer and use it in GitHub Desktop.
I don't think my class is right
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Read_r | |
class Entry | |
attr_accessor :name, :recorder, :favbook, :fiction, :minreadmon, :minreadtues, :minreadweds, :minreadthurs, :minreadoth | |
def initialize(options = {}) | |
self.name = options[:name] | |
self.recorder = options[:recorder] | |
self.favbook = options[:favbook] | |
options.keys.each do |minread| # from this block on I think is messy | |
# I want to check if an option is one of the minread* accesssors above | |
# It seems to me that I'm doing this whole method wrong, duplicating a lot | |
# of code. | |
self.send(((minread.to_s).+ "=").to_sym, options[minread]) if minread.to_s.include?("minread") | |
end | |
end | |
def save(filename) | |
end | |
end # Entry class | |
end #read_r module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment