Class: PairKit::JsonSchema::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/pair_kit/json_schema/dsl.rb,
lib/pair_kit/json_schema/dsl/version.rb,
lib/pair_kit/json_schema/dsl/nodes/array_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/number_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/schema_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/string_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/boolean_dsl.rb,
lib/pair_kit/json_schema/dsl/nodes/property_dsl.rb,
lib/pair_kit/json_schema/dsl/scaffolds/scaffold.rb,
lib/pair_kit/json_schema/dsl/nodes/array_item_dsl.rb,
lib/pair_kit/json_schema/dsl/scaffolds/hash_scaffold.rb,
lib/pair_kit/json_schema/dsl/scaffolds/array_scaffold.rb,
lib/pair_kit/json_schema/dsl/partials/core_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/enum_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/null_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/type_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/scaffolds/scalar_scaffold.rb,
lib/pair_kit/json_schema/dsl/partials/const_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/common_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/numeric_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/meta_data_partial_dsl.rb,
lib/pair_kit/json_schema/dsl/partials/structural_partial_dsl.rb

Defined Under Namespace

Modules: ArrayDsl, ArrayItemDsl, BooleanDsl, CommonPartialDsl, ConstPartialDsl, CorePartialDsl, EnumPartialDsl, MetaDataPartialDsl, NullPartialDsl, NumberDsl, NumericPartialDsl, ObjectDsl, PropertyDsl, SchemaDsl, StringDsl, StructuralPartialDsl, TypePartialDsl Classes: ArrayScaffold, HashScaffold, Scaffold, ScalarScaffold

Constant Summary collapse

BASE_DSL =
DslFactory.new do
  configure_builder :schema, SchemaDsl
  configure_builder :array, ArrayDsl
  configure_builder :object, ObjectDsl
  configure_builder :number, NumberDsl
  configure_builder :integer, NumberDsl
  configure_builder :string, StringDsl
  configure_builder :property, PropertyDsl
  configure_builder :array_item, ArrayItemDsl
end
VERSION =
'0.0.1'

Instance Method Summary collapse

Instance Method Details

#build(&block) ⇒ Object



46
47
48
# File 'lib/pair_kit/json_schema/dsl.rb', line 46

def build(&block)
  BASE_DSL.build(Scaffold.wrap({}), &block).to_schema
end