def initialize_from_hash(hsh)
      hsh.first.each_pair do |k, v|
        if self.class.members.include?(k.to_sym)
          self.public_send("#{k}=", v)
        else
          raise NameError, "Trying to assign non-existing member #{k}=#{v}"
        end
      end
    end
def initialize_from_hash(hsh)
      hsh.first.each_pair do |k, v|
        if self.class.members.include?(k.to_sym)
          self.public_send("#{k}=", v)
        else
          raise NameError, "Trying to assign non-existing member #{k}=#{v}"
        end
      end
    end
Entity constructor from a Hash

 @param [Hash] hsh hash of values

 @example
   class Person
     include StronglyTyped::Model

     attribute :id, Integer
     attribute :slug, String
   end

   Person.new(id: 1, slug: 'elgalu')
   #=> #<Person:0x00c98 @id=1, @slug="elgalu">
   leo.id   #=> 1
   leo.slug #=> "elgalu"

 @raise [NameError] if tries to assign a non-existing member

 @private