Class: Shale::Schema::Compiler::XMLProperty Private

Inherits:
Property
  • Object
show all
Defined in:
lib/shale/schema/compiler/xml_property.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class representing Shale’s property

Instance Attribute Summary collapse

Attributes inherited from Property

#attribute_name, #mapping_name, #type

Instance Method Summary collapse

Methods inherited from Property

#collection?, #default

Constructor Details

#initialize(name:, type:, collection:, default:, prefix:, namespace:, category:) ⇒ XMLProperty

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize object

Parameters:

  • name (String)
  • type (Shale::Schema::Compiler::Type)
  • collection (true, false)
  • default (Object)
  • prefix (String)
  • namespace (String)
  • category (Symbol)


37
38
39
40
41
42
# File 'lib/shale/schema/compiler/xml_property.rb', line 37

def initialize(name:, type:, collection:, default:, prefix:, namespace:, category:)
  super(name, type, collection, default)
  @prefix = prefix
  @namespace = namespace
  @category = category
end

Instance Attribute Details

#namespaceString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return namespace URI

Returns:



17
18
19
# File 'lib/shale/schema/compiler/xml_property.rb', line 17

def namespace
  @namespace
end

#prefixString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return namespace prefix

Returns:



24
25
26
# File 'lib/shale/schema/compiler/xml_property.rb', line 24

def prefix
  @prefix
end

Instance Method Details

#attribute?true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if property’s category is attribute

Returns:

  • (true, false)


58
59
60
# File 'lib/shale/schema/compiler/xml_property.rb', line 58

def attribute?
  @category == :attribute
end

#content?true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if property’s category is content

Returns:

  • (true, false)


49
50
51
# File 'lib/shale/schema/compiler/xml_property.rb', line 49

def content?
  @category == :content
end

#element?true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Check if property’s category is element

Returns:

  • (true, false)


67
68
69
# File 'lib/shale/schema/compiler/xml_property.rb', line 67

def element?
  @category == :element
end