Class: WsdlMapper::Dom::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl_mapper/dom/property.rb

Defined Under Namespace

Classes: Ref

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type_name, bounds: Bounds.new, sequence: 0, default: nil, fixed: nil, form: nil) ⇒ Property

Returns a new instance of Property.



23
24
25
26
27
28
29
# File 'lib/wsdl_mapper/dom/property.rb', line 23

def initialize(name, type_name, bounds: Bounds.new, sequence: 0, default: nil, fixed: nil, form: nil)
  @name, @type_name, @bounds, @sequence = name, type_name, bounds, sequence
  @documentation = Documentation.new
  @default = default
  @fixed = fixed
  @form = form
end

Instance Attribute Details

#boundsObject (readonly)

Returns the value of attribute bounds.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def bounds
  @bounds
end

#containing_typeObject

Returns the value of attribute containing_type.



20
21
22
# File 'lib/wsdl_mapper/dom/property.rb', line 20

def containing_type
  @containing_type
end

#defaultObject (readonly)

Returns the value of attribute default.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def default
  @default
end

#documentationObject

Returns the value of attribute documentation.



21
22
23
# File 'lib/wsdl_mapper/dom/property.rb', line 21

def documentation
  @documentation
end

#fixedObject (readonly)

Returns the value of attribute fixed.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def fixed
  @fixed
end

#formObject (readonly)

Returns the value of attribute form.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def form
  @form
end

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def name
  @name
end

#sequenceObject (readonly)

Returns the value of attribute sequence.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def sequence
  @sequence
end

#typeObject

Returns the value of attribute type.



20
21
22
# File 'lib/wsdl_mapper/dom/property.rb', line 20

def type
  @type
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



19
20
21
# File 'lib/wsdl_mapper/dom/property.rb', line 19

def type_name
  @type_name
end

Instance Method Details

#array?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/wsdl_mapper/dom/property.rb', line 39

def array?
  @bounds.max.nil?
end

#default?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/wsdl_mapper/dom/property.rb', line 31

def default?
  !!@default
end

#fixed?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/wsdl_mapper/dom/property.rb', line 35

def fixed?
  !!@fixed
end

#optional?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/wsdl_mapper/dom/property.rb', line 47

def optional?
  @bounds.min == 0 && @bounds.max == 1
end

#required?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/wsdl_mapper/dom/property.rb', line 51

def required?
  @bounds.min > 0
end

#single?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/wsdl_mapper/dom/property.rb', line 43

def single?
  @bounds.min == 1 && @bounds.max == 1
end