Module: PairKit::JsonSchema::Dsl::PropertyDsl

Defined in:
lib/pair_kit/json_schema/dsl/nodes/property_dsl.rb

Overview

Instance Method Summary collapse

Instance Method Details

#dependent_on(*dependencies) ⇒ Object



18
19
20
# File 'lib/pair_kit/json_schema/dsl/nodes/property_dsl.rb', line 18

def dependent_on(*dependencies)
  @subject['dependentRequired', {}][@options[:name], []] += dependencies
end

#optionalObject



14
15
16
# File 'lib/pair_kit/json_schema/dsl/nodes/property_dsl.rb', line 14

def optional
  @subject['required', []].delete(Miniflector.camel_case(@options[:name]))
end

#requiredObject



10
11
12
# File 'lib/pair_kit/json_schema/dsl/nodes/property_dsl.rb', line 10

def required
  @subject['required', []] << Miniflector.camel_case(@options[:name])
end