Sha256: b39f104d785072f578ebd6574c7790536b525461bcd48d8374c3048a07e1b430

Contents?: true

Size: 562 Bytes

Versions: 6

Compression:

Stored size: 562 Bytes

Contents

module EnumeratedAttribute
	module Integrations

		module Default
			def self.included(klass); klass.extend(ClassMethods); end
		
			module ClassMethods
				def define_enumerated_attribute_writer_method name
					name = name.to_s
					class_eval <<-METHOD
						def #{name}=(val); write_enumerated_attribute(:#{name}, val); end    
					METHOD
				end
				
				def define_enumerated_attribute_reader_method name
					name = name.to_s
					class_eval <<-METHOD
						def #{name}; read_enumerated_attribute(:#{name}); end
					METHOD
				end
			end
		end

	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jeffp-enumerated_attribute-0.1.6 lib/enumerated_attribute/integrations/default.rb
jeffp-enumerated_attribute-0.1.7 lib/enumerated_attribute/integrations/default.rb
jeffp-enumerated_attribute-0.2.0.2 lib/enumerated_attribute/integrations/default.rb
jeffp-enumerated_attribute-0.2.1 lib/enumerated_attribute/integrations/default.rb
jeffp-enumerated_attribute-0.2.2 lib/enumerated_attribute/integrations/default.rb
jeffp-enumerated_attribute-0.2.3 lib/enumerated_attribute/integrations/default.rb