Category Archives: Ruby
26
January
Written by admin.
Posted in: Ruby
First, create the interface as a “mixin” (a Ruby module that will be included into another). module Sociable @@must_have = [:smile, :feign_interest, :paraphrase, :laugh_at_bad_jokes] class << self def included (b) @@must_have.each do |m| raise NotImplementedError, "’#{b}’ must implement the ‘#{m}’ method" unless b.method_defined? m end end end end Here you can see we have a [...]
Lately I’ve been doing a bit of Rails development for an important project at work. While I really enjoy working with the Ruby programming language and Rails (and ActiveRecord) can be huge time savers, I occasionally find myself wishing I was working with Java instead. I have several major beefs with Ruby on Rails, as [...]