Module: PairKit::JsonSchema::Dsl::MetaDataPartialDsl
- Included in:
- CommonPartialDsl
- Defined in:
- lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb
Overview
Instance Method Summary collapse
- #default(val) ⇒ Object
- #deprecated ⇒ Object
- #description(description = nil, &block) ⇒ Object
- #example(example = nil, &block) ⇒ Object
- #read_only ⇒ Object
- #readable ⇒ Object
- #title(title) ⇒ Object
- #writable ⇒ Object
- #write_only ⇒ Object
Instance Method Details
#default(val) ⇒ Object
16 17 18 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 16 def default(val) @subject['default'] = val end |
#deprecated ⇒ Object
20 21 22 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 20 def deprecated @subject['deprecated'] = true end |
#description(description = nil, &block) ⇒ Object
12 13 14 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 12 def description(description = nil, &block) @subject['description'] = description || block&.call end |
#example(example = nil, &block) ⇒ Object
24 25 26 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 24 def example(example = nil, &block) @subject['examples', []] << example || block&.call end |
#read_only ⇒ Object
28 29 30 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 28 def read_only @subject['readOnly'] = true end |
#readable ⇒ Object
40 41 42 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 40 def readable @subject['writeOnly'] = false end |
#title(title) ⇒ Object
8 9 10 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 8 def title(title) @subject['title'] = title end |
#writable ⇒ Object
32 33 34 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 32 def writable @subject['readOnly'] = false end |
#write_only ⇒ Object
36 37 38 |
# File 'lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb', line 36 def write_only @subject['writeOnly'] = true end |