Skip to content

Commit

Permalink
Merge pull request #1944 from tubaxenor/xc-aasm-private-methods-change
Browse files Browse the repository at this point in the history
Fix AASM compiler's global callback method signatures
  • Loading branch information
KaanOzkan authored Jul 8, 2024
2 parents ba97057 + 08610fb commit c6abadd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion lib/tapioca/dsl/compilers/aasm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def decorate
machine.create_method(
method,
parameters: [
create_opt_param("symbol", type: "T.nilable(Symbol)", default: "nil"),
create_rest_param("callbacks", type: "T.any(String, Symbol, T::Class[T.anything], Proc)"),
create_block_param("block", type: "T.nilable(T.proc.bind(#{constant_name}).void)"),
],
)
Expand Down
84 changes: 42 additions & 42 deletions spec/tapioca/dsl/compilers/aasm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ def aasm(*args, &block); end
end
class PrivateAASMMachine < AASM::Base
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(*callbacks, &block); end
sig { params(name: T.untyped, options: T.untyped, block: T.proc.bind(PrivateAASMEvent).void).returns(T.untyped) }
def event(name, options = nil, &block); end
Expand Down Expand Up @@ -224,26 +224,26 @@ def aasm(*args, &block); end
end
class PrivateAASMMachine < AASM::Base
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(*callbacks, &block); end
sig { params(name: T.untyped, options: T.untyped, block: T.proc.bind(PrivateAASMEvent).void).returns(T.untyped) }
def event(name, options = nil, &block); end
Expand Down Expand Up @@ -351,26 +351,26 @@ def aasm(*args, &block); end
end
class PrivateAASMMachine < AASM::Base
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def after_all_transitions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def before_all_transactions(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def ensure_on_all_events(*callbacks, &block); end
sig { params(symbol: T.nilable(Symbol), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(symbol = nil, &block); end
sig { params(callbacks: T.any(String, Symbol, T::Class[T.anything], Proc), block: T.nilable(T.proc.bind(StateMachine).void)).returns(T.untyped) }
def error_on_all_events(*callbacks, &block); end
sig { params(name: T.untyped, options: T.untyped, block: T.proc.bind(PrivateAASMEvent).void).returns(T.untyped) }
def event(name, options = nil, &block); end
Expand Down

0 comments on commit c6abadd

Please sign in to comment.