lib/swift/attribute.rb in swift-0.10.0 vs lib/swift/attribute.rb in swift-0.11.0
- old
+ new
@@ -27,9 +27,16 @@
@key = options.fetch(:key, false)
@serial = options.fetch(:serial, false)
define_scheme_methods(scheme)
end
+ # The attributes field.
+ #
+ # @return [String]
+ def to_s
+ field.to_s
+ end
+
# Evals attribute accessors for this attribute into the scheme.
def define_scheme_methods scheme
scheme.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name}; tuple.fetch(:#{field}, nil) end
def #{name}= value; tuple.store(:#{field}, value) end