lib/basic_serializer/dsl.rb in basic_serializer-0.1.6 vs lib/basic_serializer/dsl.rb in basic_serializer-0.1.7

- old
+ new

@@ -4,11 +4,11 @@ module DSL def attributes @attributes ||= {} end - def attribute(name, type) - attributes[name] = type + def attribute(name, type = nil) + attributes[name] = type || :default return if method_defined?(name) define_method(name) { object.send(name) } end