Class: Apiwork::Adapter::Capability::Operation::MetadataShape
- Inherits:
-
Object
- Object
- Apiwork::Adapter::Capability::Operation::MetadataShape
- 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.
Instance Attribute Summary collapse
-
#options ⇒ Configuration
readonly
The capability options for this metadata shape.
Class Method Summary collapse
Instance Method Summary collapse
- #apply ⇒ Object
- #array(name, **options, &block) ⇒ Object
- #array?(name, **options, &block) ⇒ Object
- #binary(name, **options) ⇒ Object
- #binary?(name, **options) ⇒ Object
- #boolean(name, **options) ⇒ Object
- #boolean?(name, **options) ⇒ Object
- #date(name, **options) ⇒ Object
- #date?(name, **options) ⇒ Object
- #datetime(name, **options) ⇒ Object
- #datetime?(name, **options) ⇒ Object
- #decimal(name, **options) ⇒ Object
- #decimal?(name, **options) ⇒ Object
-
#initialize(object, options) ⇒ MetadataShape
constructor
A new instance of MetadataShape.
- #integer(name, **options) ⇒ Object
- #integer?(name, **options) ⇒ Object
- #literal(name, value:, **options) ⇒ Object
- #merge(other) ⇒ Object
- #number(name, **options) ⇒ Object
- #number?(name, **options) ⇒ Object
- #object(name, **options, &block) ⇒ Object
- #object?(name, **options, &block) ⇒ Object
- #reference(name, **options) ⇒ Object
- #reference?(name, **options) ⇒ Object
- #string(name, **options) ⇒ Object
- #string?(name, **options) ⇒ Object
- #time(name, **options) ⇒ Object
- #time?(name, **options) ⇒ Object
- #union(name, **options, &block) ⇒ Object
- #union?(name, **options, &block) ⇒ Object
- #uuid(name, **options) ⇒ Object
- #uuid?(name, **options) ⇒ Object
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, ) @object = object @options = end |
Instance Attribute Details
#options ⇒ Configuration (readonly)
The capability options for this metadata shape.
29 30 31 |
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 29 def @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, ) new(object, ).apply end |
Instance Method Details
#apply ⇒ Object
158 159 160 |
# File 'lib/apiwork/adapter/capability/operation/metadata_shape.rb', line 158 def apply raise NotImplementedError end |
#array(name, **options, &block) ⇒ 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 |
#array?(name, **options, &block) ⇒ 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 |
#binary(name, **options) ⇒ 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 |
#binary?(name, **options) ⇒ 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 |
#boolean(name, **options) ⇒ 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 |
#boolean?(name, **options) ⇒ 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 |
#date(name, **options) ⇒ 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 |
#date?(name, **options) ⇒ 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 |
#datetime(name, **options) ⇒ 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 |
#datetime?(name, **options) ⇒ 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 |
#decimal(name, **options) ⇒ 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 |
#decimal?(name, **options) ⇒ 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 |
#integer(name, **options) ⇒ 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 |
#integer?(name, **options) ⇒ 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 |
#literal(name, value:, **options) ⇒ 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 |
#merge(other) ⇒ 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 |
#number(name, **options) ⇒ 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 |
#number?(name, **options) ⇒ 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
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
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
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
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
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
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
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
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
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
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
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
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 |