Sha256: f62ca59cbf6c319859469baf94ed38453928c50dd89d3b4c2361521af138c25e
Contents?: true
Size: 415 Bytes
Versions: 20
Compression:
Stored size: 415 Bytes
Contents
module OAttr def self.included(base) base.extend ClassMethods end module ClassMethods def oattr *names container = if names.last.kind_of? Hash "@#{(names.pop)[:container]}" else "@options" end names.each do |name| class_eval "def #{name}; #{container}['#{name}'.to_sym]; end" end end end end
Version data entries
20 entries across 20 versions & 1 rubygems