Class: Icss::Meta::SimpleSchema

Inherits:
NamedSchema show all
Defined in:
lib/icss/type/structured_schema.rb,
lib/icss/type.rb

Overview

Description of a simple type (derived from one of the base classes)

Simple uses the type name “simple” and supports the attributes:

  • name: a string naming this fixed (required).

  • namespace, a string that qualifies the name;

Direct Known Subclasses

RecordSchema

Instance Attribute Summary

Attributes inherited from NamedSchema

#is_core

Instance Method Summary collapse

Methods inherited from NamedSchema

#attrs_to_inscribe, #is_core?, #model_klass, receive, #to_hash

Methods included from ReceiverModel::ActsAsHash

#[], #[]=, #attributes, #delete, included, #keys, #to_hash

Methods included from RecordModel

#attr_set?, included, #receive!, #to_zaml

Instance Method Details

#basename=(s) ⇒ Object



267
268
269
270
271
# File 'lib/icss/type/structured_schema.rb', line 267

def basename=(s)
  segs = s.to_s.split(/\./)
  @basename = segs.pop.to_sym
  @namespace = segs.join('.').to_s if segs.present?
end

#fullnameObject



274
275
276
# File 'lib/icss/type/structured_schema.rb', line 274

def fullname
  [namespace, basename].compact_blank.join('.')
end

#parent_klassObject



280
# File 'lib/icss/type/structured_schema.rb', line 280

def parent_klass()      is_a.first ; end

#parent_metamodelsObject



281
282
283
284
# File 'lib/icss/type/structured_schema.rb', line 281

def parent_metamodels()
  return [] if is_a.length <= 1
  is_a[1 .. -1].map{|pk| pk.metamodel if pk.respond_to?(:metamodel) }.compact
end

#receive_basename(s) ⇒ Object



272
# File 'lib/icss/type/structured_schema.rb', line 272

def receive_basename(s) self.basename = s.to_sym ; end

#typeObject



278
# File 'lib/icss/type/structured_schema.rb', line 278

def type() :simple ; end