Class: Virtus::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/pineapples/templates/lib/virtus/virtus.rb

Defined Under Namespace

Modules: Accessor

Instance Method Summary collapse

Instance Method Details

#define_accessor_methods(attribute_set) ⇒ Object



4
5
6
7
8
# File 'lib/pineapples/templates/lib/virtus/virtus.rb', line 4

def define_accessor_methods(attribute_set)
  attribute_set.define_reader_method(self, name, options[:reader])
  attribute_set.define_writer_method(self, "#{name}=", options[:writer])
  attribute_set.define_presence_method(self, "#{name}?", options[:reader])
end