Module: Pathway::Plugins::Base::InstanceMethods
- Extended by:
- Forwardable
- Defined in:
- lib/pathway.rb
Instance Method Summary collapse
- #call ⇒ Object
- #error(type, message: nil, details: nil) ⇒ Object
- #wrap_if_present(value, type: :not_found, message: nil, details: {}) ⇒ Object
Instance Method Details
#call ⇒ Object
142 143 144 |
# File 'lib/pathway.rb', line 142 def call(*) fail 'must implement at subclass' end |
#error(type, message: nil, details: nil) ⇒ Object
146 147 148 |
# File 'lib/pathway.rb', line 146 def error(type, message: nil, details: nil) failure(Error.new(type: type, message: , details: details)) end |
#wrap_if_present(value, type: :not_found, message: nil, details: {}) ⇒ Object
150 151 152 |
# File 'lib/pathway.rb', line 150 def wrap_if_present(value, type: :not_found, message: nil, details: {}) value.nil? ? error(type, message: , details: details) : success(value) end |