Sha256: 2f35fe362558742c73e6f854fd9faf9c9a99b5022003920edb1757bfeac642a7
Contents?: true
Size: 475 Bytes
Versions: 26
Compression:
Stored size: 475 Bytes
Contents
module Clapton class State attr_reader :attributes attr_accessor :errors def initialize(params = {}) @attributes = params @errors = [] end def to_h @attributes end def self.attribute(attribute_name) define_method(attribute_name) do @attributes[attribute_name.to_sym] end define_method("#{attribute_name}=") do |value| @attributes[attribute_name.to_sym] = value end end end end
Version data entries
26 entries across 26 versions & 1 rubygems