Skip to content

Instantly share code, notes, and snippets.

@seangaffney
Created May 23, 2014 01:40
Show Gist options
  • Save seangaffney/1400b07b4299f40da853 to your computer and use it in GitHub Desktop.
Save seangaffney/1400b07b4299f40da853 to your computer and use it in GitHub Desktop.
DummyCourse = Struct.new(:title) do
def description
"Courses have been discontinued. This course contains all syllabi."
end
def published_for_ios
true
end
def created_at
nil
end
def updated_at
nil
end
# etc...
def read_attribute_for_serialization(attribute)
self.send(attribute)
end
end
course = DummyCourse.new("Course")
puts course
puts course.read_attribute_for_serialization(:published_for_ios)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment