Class: Ruff::Standard::CurrentTime::Instance
- Inherits:
-
Object
- Object
- Ruff::Standard::CurrentTime::Instance
- Defined in:
- lib/ruff/standard/current_time.rb
Instance Attribute Summary collapse
-
#eff ⇒ Object
readonly
You can reimplement the handler using this effect instance.
Instance Method Summary collapse
-
#get ⇒ Time
is a smart method to invoke the effect operation.
-
#initialize ⇒ Instance
constructor
makes a new instance.
-
#with(&th) ⇒ A!{e}
is a handler to interpret the effect invokation as requesting the current time.
Constructor Details
Instance Attribute Details
#eff ⇒ Object (readonly)
You can reimplement the handler using this effect instance.
37 38 39 |
# File 'lib/ruff/standard/current_time.rb', line 37 def eff @eff end |
Instance Method Details
#get ⇒ Time
is a smart method to invoke the effect operation.
18 19 20 |
# File 'lib/ruff/standard/current_time.rb', line 18 def get @eff.perform end |
#with(&th) ⇒ A!{e}
is a handler to interpret the effect invokation as requesting the current time. This handler receives the request and returns current time.
32 33 34 |
# File 'lib/ruff/standard/current_time.rb', line 32 def with(&th) @handler.run(&th) end |