Class: Mpp::Server::FunctionalIntent
- Inherits:
-
Object
- Object
- Mpp::Server::FunctionalIntent
- Extended by:
- T::Sig
- Defined in:
- lib/mpp/server/intent.rb
Overview
Function-based intent wrapper.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, &verify_fn) ⇒ FunctionalIntent
constructor
A new instance of FunctionalIntent.
- #verify(credential, request) ⇒ Object
Constructor Details
#initialize(name, &verify_fn) ⇒ FunctionalIntent
Returns a new instance of FunctionalIntent.
22 23 24 25 |
# File 'lib/mpp/server/intent.rb', line 22 def initialize(name, &verify_fn) @name = T.let(name, String) @verify_fn = T.let(verify_fn, T.proc.params(arg0: Mpp::Credential, arg1: T::Hash[String, T.untyped]).returns(Mpp::Receipt)) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/mpp/server/intent.rb', line 19 def name @name end |
Instance Method Details
#verify(credential, request) ⇒ Object
28 29 30 |
# File 'lib/mpp/server/intent.rb', line 28 def verify(credential, request) @verify_fn.call(credential, request) end |