lib/reviewed/base.rb in reviewed-0.1.4 vs lib/reviewed/base.rb in reviewed-0.1.21

- old
+ new

@@ -10,26 +10,10 @@ def initialize(data) self.attributes = objectify(data) end - def created_at - if @attributes.has_key?(:created_at) - Time.parse(@attributes[:created_at]) - else - nil - end - end - - def updated_at - if @attributes.has_key?(:updated_at) - Time.parse(@attributes[:updated_at]) - else - nil - end - end - class << self def path @resource_name ||= association_name end @@ -37,12 +21,11 @@ def association_name self.name.demodulize.downcase.pluralize end end - def respond_to?(sym, include_private=false) - return true if super - @attributes.has_key?(sym) + def initialize(data) + self.attributes = objectify(data) end def method_missing(sym, *args, &block) if @attributes.has_key?(sym) @attributes[sym]