Class: Apiwork::Adapter::Capability::Operation::MetadataShape

Inherits:
Object
  • Object
show all
Defined in:
lib/apiwork/adapter/capability/operation/metadata_shape.rb

Overview

Shape builder for operation metadata.

Provides #options for accessing capability configuration, plus all DSL methods from Apiwork::API::Object for defining structure. Used by operations to define their metadata contribution.

Examples:

Add pagination metadata shape

 do
  reference :pagination
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, options) ⇒ MetadataShape

Returns a new instance of MetadataShape.



153
154
155
156
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 153

def initialize(object, options)
  @object = object
  @options = options
end

Instance Attribute Details

#optionsConfiguration (readonly)

The capability options for this metadata shape.

Returns:



29
30
31
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 29

def options
  @options
end

Class Method Details

.apply(object, options) ⇒ Object



20
21
22
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 20

def apply(object, options)
  new(object, options).apply
end

Instance Method Details

#applyObject

Raises:

  • (NotImplementedError)


158
159
160
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 158

def apply
  raise NotImplementedError
end

#array(name, **options, &block) ⇒ Object

See Also:

  • API::Object#array


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#array?(name, **options, &block) ⇒ Object

See Also:

  • API::Object#array?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#binary(name, **options) ⇒ Object

See Also:

  • API::Object#binary


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#binary?(name, **options) ⇒ Object

See Also:

  • API::Object#binary?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#boolean(name, **options) ⇒ Object

See Also:

  • API::Object#boolean


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#boolean?(name, **options) ⇒ Object

See Also:

  • API::Object#boolean?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#date(name, **options) ⇒ Object

See Also:

  • API::Object#date


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#date?(name, **options) ⇒ Object

See Also:

  • API::Object#date?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#datetime(name, **options) ⇒ Object

See Also:

  • API::Object#datetime


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#datetime?(name, **options) ⇒ Object

See Also:

  • API::Object#datetime?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#decimal(name, **options) ⇒ Object

See Also:

  • API::Object#decimal


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#decimal?(name, **options) ⇒ Object

See Also:

  • API::Object#decimal?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#integer(name, **options) ⇒ Object

See Also:

  • API::Object#integer


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#integer?(name, **options) ⇒ Object

See Also:

  • API::Object#integer?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#literal(name, value:, **options) ⇒ Object

See Also:

  • API::Object#literal


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#merge(other) ⇒ Object

See Also:

  • API::Object#merge


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#number(name, **options) ⇒ Object

See Also:

  • API::Object#number


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#number?(name, **options) ⇒ Object

See Also:

  • API::Object#number?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#object(name, **options, &block) ⇒ Object

See Also:

  • API::Object#object


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#object?(name, **options, &block) ⇒ Object

See Also:

  • API::Object#object?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#reference(name, **options) ⇒ Object

See Also:

  • API::Object#reference


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#reference?(name, **options) ⇒ Object

See Also:

  • API::Object#reference?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#string(name, **options) ⇒ Object

See Also:

  • API::Object#string


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#string?(name, **options) ⇒ Object

See Also:

  • API::Object#string?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#time(name, **options) ⇒ Object

See Also:

  • API::Object#time


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#time?(name, **options) ⇒ Object

See Also:

  • API::Object#time?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#union(name, **options, &block) ⇒ Object

See Also:

  • API::Object#union


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#union?(name, **options, &block) ⇒ Object

See Also:

  • API::Object#union?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#uuid(name, **options) ⇒ Object

See Also:

  • API::Object#uuid


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object

#uuid?(name, **options) ⇒ Object

See Also:

  • API::Object#uuid?


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 121

delegate :array,
:array?,
:binary,
:binary?,
:boolean,
:boolean?,
:date,
:date?,
:datetime,
:datetime?,
:decimal,
:decimal?,
:integer,
:integer?,
:literal,
:merge,
:number,
:number?,
:object,
:object?,
:reference,
:reference?,
:string,
:string?,
:time,
:time?,
:union,
:union?,
:uuid,
:uuid?,
to: :@object