Sha256: 58bf4e04f95260c15798860f53215c5ba3260e6ef46297ca0d5b31a575638c0d
Contents?: true
Size: 453 Bytes
Versions: 34
Compression:
Stored size: 453 Bytes
Contents
module Orkut class Base def self.lazy_attr_reader(*attributes) attributes.each do |attribute| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{attribute} @#{attribute} ||= @attributes[#{attribute.to_s.inspect}] end RUBY end end def initialize(attributes = {}) @attributes = attributes.dup end def [](method) self.__send__(method.to_sym) end end end
Version data entries
34 entries across 34 versions & 1 rubygems