Class: JSONAPIonify::Structure::Maps::Base

Inherits:
Objects::Base show all
Defined in:
lib/jsonapionify/structure/maps/base.rb

Direct Known Subclasses

Links, Relationships

Instance Attribute Summary

Attributes inherited from Objects::Base

#errors, #object, #parent, #warnings

Class Method Summary collapse

Methods inherited from Objects::Base

#==, #===, #as_json, #compile, #compile!, #copy, define_order, from_hash, from_json, #initialize, #inspect, #pretty_json, #signature, #to_h, #to_json, #validate

Methods included from Helpers::ObjectDefaults

#[], #[]=

Methods included from Helpers::Validations

#allowed_type_map, #permitted_key?, #permitted_keys, #permitted_type_for?, #permitted_types_for, #required_key?, #required_keys

Methods included from Helpers::ObjectSetters

#[], #[]=

Methods included from Helpers::InheritsOrigin

#client?, #origin, #server?

Methods included from Callbacks

#run_callbacks

Constructor Details

This class inherits a constructor from JSONAPIonify::Structure::Objects::Base

Class Method Details

.type!(**opts) ⇒ Object



12
13
14
# File 'lib/jsonapionify/structure/maps/base.rb', line 12

def self.type!(**opts)
  type_of! '*', **opts
end

.value_is(type_class, strict: false) ⇒ Object



5
6
7
8
9
10
# File 'lib/jsonapionify/structure/maps/base.rb', line 5

def self.value_is(type_class, strict: false)
  define_method(:type_class) do
    type_class
  end
  type! must_be: type_class if strict
end