Class: JAXB2Ruby::Element

Inherits:
Node
  • Object
show all
Defined in:
lib/jaxb2ruby/classes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#accessor, #default, #local_name, #name, #namespace, #type

Instance Method Summary collapse

Methods inherited from Node

#array?, #hash?, #required?

Constructor Details

#initialize(name, options = {}) ⇒ Element

Returns a new instance of Element.



102
103
104
105
106
107
108
109
# File 'lib/jaxb2ruby/classes.rb', line 102

def initialize(name, options = {})
  super
  @text = !!options[:text]
  @root = !!options[:root]
  @nillable = !!options[:nillable]
  @children = options[:children] || []
  @attributes = options[:attributes] || []
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



100
101
102
# File 'lib/jaxb2ruby/classes.rb', line 100

def attributes
  @attributes
end

#childrenObject (readonly)

Returns the value of attribute children.



99
100
101
# File 'lib/jaxb2ruby/classes.rb', line 99

def children
  @children
end

Instance Method Details

#nillable?Boolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/jaxb2ruby/classes.rb', line 111

def nillable?
  @nillable
end

#root?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/jaxb2ruby/classes.rb', line 115

def root?
  @root
end

#text?Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/jaxb2ruby/classes.rb', line 119

def text?
  @text
end