class Sameas::Results < Sameas::Base attr_accessor :attributes def initialize(attributes = {}) @attributes = attributes.nested_symbolize_keys! end def method_missing(method, args = nil) unless @attributes.has_key?(method.to_sym) raise "No method named #{method.to_s}" end if args.nil? @attributes[method.to_sym] else @attributes[method.to_sym] = args return true end end end