Feature Request: Interfaces should suppport ivars
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the interface and mixin examples in the issue, then read the referenced PR #3256 for context. Define what interface instance variables should mean for these examples and how the behavior can be validated; done means the desired semantics are clear and the proposed feature is specified.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This is a request for an addition to the concept of Interfaces; while I get that the inspiration for RBS interfaces are Java Interfaces, where the definition of methods, and not assomuch state, is the way to define them. However, the concept is quite limiting considering what Interfaces are used for RBS/Ruby. Interfaces are the defacto way to define duck-typing. In ruby, this is not constrained to methods, specially when one considers mixins. A random example:
module IoOps
def read_and_eval
payload = @io.read
# ...
end
end
class TCPWrapper
@io: TCPSocket
end
class SSLWrapper
@io: OpenSSL::SSL::SSLSocket
end
# given that, I'd like to define a mixin for each
interface _IOWrapper
@io: _ToIO # this interface should cover both tcp and ssl sockets
end
module IoOps : _IOWrapper # https://github.com/ruby/rbs/pull/3256
end
I think this type of mixins are common enough; Think about extensions which apply to different db adapters.
- Lingua principale
- Ruby
- Stelle
- 2.2k
- Fork
- 260
- Merge medio
- 22h 3m
- PR unite (30g)
- 54
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ruby/rbs
-
InlineParser: `@rbs @ivar` annotation is reported as unused unless it is the first thing in the class bodyForse già presa @ksss l’ha presa 34 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
JWT::EncodedToken raises TypeError for a non-object headerForse già presa @anakinj l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jwt/ruby-jwt#780 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zold-io/zold-ruby-sdk#85 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 62/100