Class: Literal::Data

Inherits:
DataStructure show all
Defined in:
lib/literal/data.rb

Constant Summary

Constants included from Types

Types::CallableType, Types::LambdaType, Types::NilableBooleanType, Types::NilableCallableType, Types::NilableJSONDataType, Types::NilableLambdaType, Types::NilableProcableType, Types::ProcableType

Class Method Summary collapse

Methods inherited from DataStructure

#==, __generate_literal_methods__, #as_pack, #deconstruct, #deconstruct_keys, from_pack, #hash, #marshal_dump, #marshal_load, #to_h

Methods included from Properties

extended, #initialize, #literal_properties, #prop

Methods included from Types

#_Any, #_Any?, #_Array, #_Array?, #_Boolean, #_Boolean?, #_Callable, #_Callable?, #_Class, #_Class?, #_Constraint, #_Constraint?, #_Date, #_Date?, #_Deferred, #_Deferred?, #_Descendant, #_Descendant?, #_Enumerable, #_Enumerable?, #_Falsy, #_Float, #_Float?, #_Frozen, #_Frozen?, #_Hash, #_Hash?, #_Integer, #_Integer?, #_Interface, #_Interface?, #_Intersection, #_Intersection?, #_JSONData, #_JSONData?, #_Lambda, #_Lambda?, #_Map, #_Map?, #_Never, #_Nilable, #_Not, #_Pattern, #_Predicate, #_Procable, #_Procable?, #_Range, #_Range?, #_Set, #_Set?, #_String, #_String?, #_Symbol, #_Symbol?, #_Time, #_Time?, #_Truthy, #_Tuple, #_Tuple?, #_Union, #_Union?, #_Unit, #_Unit?, #_Void

Class Method Details

.literal_propertiesObject



9
10
11
12
13
14
15
16
17
# File 'lib/literal/data.rb', line 9

def literal_properties
	return @literal_properties if defined?(@literal_properties)

	if superclass < Literal::Data
		@literal_properties = superclass.literal_properties.dup
	else
		@literal_properties = Literal::Properties::DataSchema.new
	end
end

.prop(name, type, kind = :keyword, reader: :public, predicate: false, default: nil) ⇒ Object



5
6
7
# File 'lib/literal/data.rb', line 5

def prop(name, type, kind = :keyword, reader: :public, predicate: false, default: nil)
	super(name, type, kind, reader:, writer: false, predicate:, default:)
end