lib/materialize/entity.rb in materialize-0.4.2 vs lib/materialize/entity.rb in materialize-0.4.3

- old
+ new

@@ -2,12 +2,18 @@ module Materialize class Entity include Utils - def self.wrap(entities_data) - entities_data.map { |entity_data| new(entity_data) } + class << self + + def wrap(entities_data) + entities_data.map { |entity_data| new(entity_data) } + end + + alias :build :new + end def initialize(attributes) raise "Attributes must be a hash" unless attributes.is_a?(Hash) @@ -32,11 +38,9 @@ end else value end end - - # ----> END REMARKS def collection?(value) value.is_a? Enumerable end