Sha256: f8329157755e42691c96135cf13a3db4a446ace3d2f828cc3c4218ac9a8460f0
Contents?: true
Size: 490 Bytes
Versions: 9
Compression:
Stored size: 490 Bytes
Contents
module Mirage module Helpers module MethodBuilder def builder_methods *method_names method_names.each do |method_name| method_name = method_name.to_sym define_method method_name do |arg=nil| return instance_variable_get("@#{method_name}".to_sym) if arg.nil? instance_variable_set("@#{method_name}".to_sym, arg) self end end end alias builder_method builder_methods end end end
Version data entries
9 entries across 9 versions & 2 rubygems