Skip to content

Commit

Permalink
release 0.9.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Nov 15, 2024
1 parent 6ba55e0 commit e29e5b5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-ruby-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:
# cache-from: type=gha
# cache-to: type=gha,mode=min
push: true
labels: version=0.9.0-rc1
tags: fernapi/fern-ruby-sdk:0.9.0-rc1
labels: version=0.9.0-rc2
tags: fernapi/fern-ruby-sdk:0.9.0-rc2
94 changes: 54 additions & 40 deletions generators/ruby/sdk/src/AbstractionUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,27 +625,34 @@ export function generateService(
name: "initialize",
invocationName: "new",
// Initialize each subpackage
functionBody: Array.from(subpackages.entries()).map(([spName, sp]) => {
const subpackageClassVariable = new Variable({
name: getSubpackagePropertyNameFromIr(spName),
type: sp.classReference,
variableType: VariableType.INSTANCE
});
return new Expression({
leftSide: subpackageClassVariable,
rightSide:
sp.initializer !== undefined
? new FunctionInvocation({
onObject: sp.classReference,
baseFunction: sp.initializer,
arguments_: sp.initializer.parameters.map((param) =>
param.toArgument(requestClientProperty.toVariable(VariableType.LOCAL))
)
})
: sp.classReference,
functionBody: [
new Expression({
leftSide: requestClientProperty.toVariable(),
rightSide: requestClientProperty.name,
isAssignment: true
});
}),
}),
...Array.from(subpackages.entries()).map(([spName, sp]) => {
const subpackageClassVariable = new Variable({
name: getSubpackagePropertyNameFromIr(spName),
type: sp.classReference,
variableType: VariableType.INSTANCE
});
return new Expression({
leftSide: subpackageClassVariable,
rightSide:
sp.initializer !== undefined
? new FunctionInvocation({
onObject: sp.classReference,
baseFunction: sp.initializer,
arguments_: sp.initializer.parameters.map((param) =>
param.toArgument(requestClientProperty.toVariable(VariableType.LOCAL))
)
})
: sp.classReference,
isAssignment: true
});
})
],
parameters: [requestClientProperty.toParameter({})],
returnValue: syncClassReference,
documentation: subpackage.docs
Expand Down Expand Up @@ -690,27 +697,34 @@ export function generateService(
name: "initialize",
invocationName: "new",
// Initialize each subpackage
functionBody: Array.from(asyncSubpackages.entries()).map(([spName, sp]) => {
const subpackageClassVariable = new Variable({
name: getSubpackagePropertyNameFromIr(spName),
type: sp.classReference,
variableType: VariableType.INSTANCE
});
return new Expression({
leftSide: subpackageClassVariable,
rightSide:
sp.initializer !== undefined
? new FunctionInvocation({
onObject: sp.classReference,
baseFunction: sp.initializer,
arguments_: sp.initializer.parameters.map((param) =>
param.toArgument(asyncRequestClientProperty.toVariable(VariableType.LOCAL))
)
})
: sp.classReference,
functionBody: [
new Expression({
leftSide: requestClientProperty.toVariable(),
rightSide: requestClientProperty.name,
isAssignment: true
});
}),
}),
...Array.from(asyncSubpackages.entries()).map(([spName, sp]) => {
const subpackageClassVariable = new Variable({
name: getSubpackagePropertyNameFromIr(spName),
type: sp.classReference,
variableType: VariableType.INSTANCE
});
return new Expression({
leftSide: subpackageClassVariable,
rightSide:
sp.initializer !== undefined
? new FunctionInvocation({
onObject: sp.classReference,
baseFunction: sp.initializer,
arguments_: sp.initializer.parameters.map((param) =>
param.toArgument(asyncRequestClientProperty.toVariable(VariableType.LOCAL))
)
})
: sp.classReference,
isAssignment: true
});
})
],
parameters: [requestClientProperty.toParameter({})],
returnValue: asyncClassReference,
documentation: subpackage.docs
Expand Down

0 comments on commit e29e5b5

Please sign in to comment.