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;
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
#[], #[]=, #attributes, #delete, included, #keys, #to_hash
#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
|
274
275
276
|
# File 'lib/icss/type/structured_schema.rb', line 274
def fullname
[namespace, basename].compact_blank.join('.')
end
|
#parent_klass ⇒ Object
280
|
# File 'lib/icss/type/structured_schema.rb', line 280
def parent_klass() is_a.first ; end
|
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
|
278
|
# File 'lib/icss/type/structured_schema.rb', line 278
def type() :simple ; end
|