Module: Fluxo::Operation::Attributes::ClassMethods
- Defined in:
- lib/fluxo/operation/attributes.rb
Instance Attribute Summary collapse
-
#strict ⇒ Object
writeonly
Auto handle errors/exceptions.
-
#validations_proxy ⇒ Object
readonly
This variable is used only when ActiveModel is available.
Instance Method Summary collapse
- #required_attributes ⇒ Object
- #strict? ⇒ Boolean
- #transient_attributes ⇒ Object
- #validate_attributes(*attributes) ⇒ Object (also: #require_attribute, #attributes)
- #validations ⇒ Object
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_proxy ⇒ Object (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_attributes ⇒ Object
27 28 29 |
# File 'lib/fluxo/operation/attributes.rb', line 27 def required_attributes @required_attributes ||= [] end |
#strict? ⇒ 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_attributes ⇒ Object
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 |
#validations ⇒ Object
23 24 25 |
# File 'lib/fluxo/operation/attributes.rb', line 23 def validations raise NotImplementedError, "ActiveModel is not defined to use validations." end |