Method: AttrJson::Model.to_type

Defined in:
lib/attr_json/model.rb

.to_type(strip_nils: :safely) ⇒ Object

an AttrJson::Record or ::Model attribute

Parameters:

  • strip_nils (Boolean, Symbol) (defaults to: :safely)

    [true,false,:safely] as a type, should we strip nils when serializing? By default this type strips nils in :safely mode. See AttrJson::Model#serializable_hash



163
164
165
# File 'lib/attr_json/model.rb', line 163

def to_type(strip_nils: :safely)
  @type ||= AttrJson::Type::Model.new(self, strip_nils: strip_nils)
end