Class: JsonSchemaView::BaseProps Abstract

Inherits:
Object
  • Object
show all
Includes:
JsonSchemaDefinable
Defined in:
lib/json_schema_view/base_props.rb

Overview

This class is abstract.

Class Method Summary collapse

Methods included from JsonWorldExtensions::Validatable

#validate_json!

Methods included from JsonWorldExtensions::CompactOptionalProperties

#properties

Class Method Details

.component_classClass<BaseComponent>

Returns the component class this class belongs to.

Returns:

  • (Class<BaseComponent>)

    the component class this class belongs to.



27
28
29
# File 'lib/json_schema_view/base_props.rb', line 27

def component_class
  module_parent
end

.component_nameString

Returns The name of its component class.

Returns:

  • (String)

    The name of its component class.



22
23
24
# File 'lib/json_schema_view/base_props.rb', line 22

def component_name
  component_class.name
end

.descriptionString

Note:

Override of JsonWorld::DSL::ClassMethods#description

Returns:

  • (String)


17
18
19
# File 'lib/json_schema_view/base_props.rb', line 17

def description
  "The property of #{ActiveSupport::Inflector.demodulize(component_name)}."
end

.titleString

Note:

Override of JsonWorld::DSL::ClassMethods#title

Returns its component name with Props suffix.

Returns:

  • (String)

    its component name with Props suffix.



11
12
13
# File 'lib/json_schema_view/base_props.rb', line 11

def title
  "#{ActiveSupport::Inflector.demodulize(component_name)}Props"
end