Comments (8)
It seels like the probelm is hardcoded input
which should be replaced with @origin
from actor.
Oh indeed. Right now the options only make sense to inputs as they are checked on call
.
I’d be tempted to raise an error on any option passed to output
as they are not supported.
Or we could make sure they actually work, but that would mean doing the check on the value_result=
method call instead, I guess?
from actor.
Or we could make sure they actually work, but that would mean doing the check on the value_result= method call instead, I guess?
I'd prefer to make it working, it seems to be quite useful
from actor.
Happy to accept a PR to make type:
work for outputs 🙏🏻
Actually instead of on the #value_result=
method call it would make more sense to do that at the end of the #call
, when exiting the actor.
from actor.
Hm, It seems like I misunderstood you.
The following actor
# frozen_string_literal: true
class AddGreetingWithDefault < Actor
input :name, default: "world", type: String
output :greeting, type: String
def call
self.greeting = 1
end
end
works quite good, it throws
ServiceActor::ArgumentError: The "greeting" output on "AddGreetingWithDefault" must be of type "String" but was "Integer"
from actor.
Yes! My bad, I’ve misunderstood the issue. I forgot that checks actually worked on outputs, I just never used them 🙈
I think the DefaultCheck
doesn’t make much sense on outputs and should be probably be skipped in that case.
from actor.
Just to make sure I got you correctly, current behavior of
class WithUnsetOutput < Actor
output :value, type: String, allow_nil: true
end
is
ServiceActor::ArgumentError:
The "value" input on "WithUnsetOutput" is missing
And if we skep default_check on outputs we'd expect it to complete successfuly with value == nil
, right?
from actor.
Yeah, I think that would make sense.
from actor.
Related Issues (20)
- Feature request: use other input values in default HOT 4
- alias_input is documented but unavailable HOT 1
- What about improving the README about testing? HOT 1
- Get "TypeError: exception class/object expected" error when update from 3.1.3 to 3.6 HOT 2
- Question / feature request: hooks around call? HOT 6
- Missing note on stubbing ServiceActor::Result HOT 4
- Can't set an hash as a default value for an input HOT 1
- Keep Zeitwerk as a development dependency only HOT 2
- Consider removing `OpenStruct` usage HOT 2
- Consider dropping support for unmaintained Ruby releases HOT 1
- Make Actor result + pattern matching more pleasant HOT 1
- Actor's output names collision with `Object`'s instance methods HOT 2
- Using `Kernel.tap` and `Kernel.then` via `ServiceActor::Result` receiver HOT 1
- Is `DefaultCheck` obsolete? HOT 4
- Invoking undefined methods on `ServiceActor::Result` will lead to runtime errors in the next major release of Actor. HOT 29
- Release notes for 3.8.0 HOT 8
- [Proposal] Default outputs via `output_of` actor class method HOT 3
- Breaking changes on ServiceActor::Result `failure?` after dropping `ostruct` ??? HOT 5
- Repeated `play` execution on 3.9.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actor.