Sha256: b2cec7bda43e079806430e913de6fb7c325aa9416b9b59d4767db32a04cf065a
Contents?: true
Size: 489 Bytes
Versions: 19
Compression:
Stored size: 489 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) unless arg instance_variable_set("@#{method_name}".to_sym, arg) self end end end alias builder_method builder_methods end end end
Version data entries
19 entries across 19 versions & 1 rubygems