Module: Fluxo::Operation::Attributes::ClassMethods

Defined in:
lib/fluxo/operation/attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#strict=(value) ⇒ Object (writeonly)

Auto handle errors/exceptions.



15
16
17
# File 'lib/fluxo/operation/attributes.rb', line 15

def strict=(value)
  @strict = value
end

#validations_proxyObject (readonly)

This variable is used only when ActiveModel is available.



12
13
14
# File 'lib/fluxo/operation/attributes.rb', line 12

def validations_proxy
  @validations_proxy
end

Instance Method Details

#required_attributesObject



27
28
29
# File 'lib/fluxo/operation/attributes.rb', line 27

def required_attributes
  @required_attributes ||= []
end

#strict?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/fluxo/operation/attributes.rb', line 17

def strict?
  return @strict if defined? @strict

  @strict = Fluxo.config.strict?
end

#transient_attributesObject



38
39
40
# File 'lib/fluxo/operation/attributes.rb', line 38

def transient_attributes(*)
  puts "DEPRECATED: #{__method__} is deprecated. Operation runs on sloppy mode by allowing any transient attribute."
end

#validate_attributes(*attributes) ⇒ Object Also known as: require_attribute, attributes



31
32
33
34
# File 'lib/fluxo/operation/attributes.rb', line 31

def validate_attributes(*attributes)
  @required_attributes ||= []
  @required_attributes |= attributes
end

#validationsObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/fluxo/operation/attributes.rb', line 23

def validations
  raise NotImplementedError, "ActiveModel is not defined to use validations."
end