Skip to content

Commit 986df6d

Browse files
committed
rename scope WithDefinitions to WithValues
1 parent f30fbed commit 986df6d

14 files changed

Lines changed: 25 additions & 25 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Example_ageVerification() {
4545

4646
scope, err := gon.
4747
NewScope().
48-
WithDefinitions(gon.Definitions{
48+
WithValues(gon.Values{
4949
"person": gon.Literal(person),
5050
})
5151
if err != nil {

definition_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
)
1010

1111
type (
12-
// Definitions defines how scope definitions are configured.
12+
// Values defines how scope definitions are configured.
1313
// The key must be an alphanumeric+underscore+dash string from length 1 to 50, starting with a letter.
14-
Definitions map[string]adapters.Value
14+
Values map[string]adapters.Value
1515

1616
definitionStore struct {
1717
store map[string]adapters.Value

examples/age-verification/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Example_ageVerification() {
1717

1818
scope, err := gon.
1919
NewScope().
20-
WithDefinitions(gon.Definitions{
20+
WithValues(gon.Values{
2121
"person": gon.Literal(person),
2222
})
2323
if err != nil {

examples/custom-node/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func Example_customNode() {
7979

8080
scope, err := gon.
8181
NewScope().
82-
WithDefinitions(gon.Definitions{
82+
WithValues(gon.Values{
8383
"var": gon.Literal("my-var"),
8484
})
8585
if err != nil {

examples/dates/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Example_dates() {
1717

1818
scope, err := gon.
1919
NewScope().
20-
WithDefinitions(gon.Definitions{
20+
WithValues(gon.Values{
2121
"person": gon.Literal(person),
2222
})
2323
if err != nil {

examples/dynamic-comparison/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Example_dynamicComparison() {
2121

2222
scope, err := gon.
2323
NewScope().
24-
WithDefinitions(gon.Definitions{
24+
WithValues(gon.Values{
2525
"person": gon.Literal(person),
2626
"age_config": gon.Literal(config),
2727
})

examples/functions/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func Example_functions() {
2222

2323
scope, err := gon.
2424
NewScope().
25-
WithDefinitions(gon.Definitions{
25+
WithValues(gon.Values{
2626
"friend": gon.Literal(person),
2727
"greet": gon.Literal(func(name string, birthday time.Time) string {
2828

examples/lazy-value/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func Example_lazyValue() {
1212

1313
scope, err := gon.
1414
NewScope().
15-
WithDefinitions(gon.Definitions{
15+
WithValues(gon.Values{
1616
"lazy": gon.Literal(func(ctx context.Context) int {
1717
called = true
1818
return 5

examples/object-access-rule/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func Example_objectAccessRule() {
2323

2424
scope, err := gon.
2525
NewScope().
26-
WithDefinitions(gon.Definitions{
26+
WithValues(gon.Values{
2727
"file": gon.Literal(file),
2828
})
2929
if err != nil {

examples_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func Test_Expression(t *testing.T) {
2323
// Context cancellation
2424
WithContext(t.Context()).
2525
// Dynamic, decoupled scope for your rules.
26-
WithDefinitions(gon.Definitions{
26+
WithValues(gon.Values{
2727
// Support for static variables of any type.
2828
"myName": gon.Literal("friendName"),
2929
// Support for structs and maps for children attributes.

0 commit comments

Comments
 (0)