Module: Packet::Entity::Base::ClassMethods

Defined in:
lib/packet/entity/base.rb

Instance Method Summary collapse

Instance Method Details

#casts(attribute, transformer) ⇒ Object



37
38
39
40
# File 'lib/packet/entity/base.rb', line 37

def casts(attribute, transformer)
  _casts[attribute.to_sym] = transformer
  attr_accessor attribute.to_sym
end

#resource_nameObject



42
43
44
# File 'lib/packet/entity/base.rb', line 42

def resource_name
  to_s.demodulize.underscore
end