Module: Commandoes::Plugins::VirtusPlugin::ClassMethods

Defined in:
lib/commandoes/plugins/virtus_plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(object) ⇒ Object



6
7
8
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 6

def self.extended(object)
  object.send(:include, Virtus.value_object)
end

Instance Method Details

#bool(value, options = {}) ⇒ Object



10
11
12
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 10

def bool(value, options={})
  attribute value, Axiom::Types::Boolean, options
end

#date(value, options = {}) ⇒ Object



14
15
16
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 14

def date(value, options={})
  attribute value, Date, options
end

#datetime(value, options = {}) ⇒ Object



18
19
20
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 18

def datetime(value, options={})
  attribute value, DateTime, options
end

#decimal(value, options = {}) ⇒ Object



22
23
24
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 22

def decimal(value, options={})
  attribute value, BigDecimal, options
end

#float(value, options = {}) ⇒ Object



26
27
28
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 26

def float(value, options={})
  attribute value, Float, options
end

#integer(value, options = {}) ⇒ Object



30
31
32
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 30

def integer(value, options={})
  attribute value, Integer, options
end

#string(value, options = {}) ⇒ Object



34
35
36
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 34

def string(value, options={})
  attribute value, String, options
end

#time(value, options = {}) ⇒ Object



38
39
40
# File 'lib/commandoes/plugins/virtus_plugin.rb', line 38

def time(value, options={})
  attribute value, Time, options
end