module Micro::Attributes::Features::Initialize
Public Class Methods
included(base)
click to toggle source
# File lib/micro/attributes/features/initialize.rb, line 6 def self.included(base) base.class_eval(<<-RUBY) def initialize(arg) self.attributes = arg end RUBY end
Public Instance Methods
with_attribute(key, val)
click to toggle source
# File lib/micro/attributes/features/initialize.rb, line 18 def with_attribute(key, val) with_attributes(key => val) end
with_attributes(arg)
click to toggle source
# File lib/micro/attributes/features/initialize.rb, line 14 def with_attributes(arg) self.class.new(attributes.merge(arg)) end