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

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

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

- (Object) bounds (readonly)

Returns the value of attribute bounds



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

def bounds
  @bounds
end

- (Object) containing_type

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

- (Object) default (readonly)

Returns the value of attribute default



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

def default
  @default
end

- (Object) documentation

Returns the value of attribute documentation



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

def documentation
  @documentation
end

- (Object) fixed (readonly)

Returns the value of attribute fixed



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

def fixed
  @fixed
end

- (Object) form (readonly)

Returns the value of attribute form



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

def form
  @form
end

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

- (Object) sequence (readonly)

Returns the value of attribute sequence



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

def sequence
  @sequence
end

- (Object) type

Returns the value of attribute type



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

def type
  @type
end

- (Object) type_name (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

- (Boolean) array?

Returns:

  • (Boolean)


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

def array?
  @bounds.max.nil?
end

- (Boolean) default?

Returns:

  • (Boolean)


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

def default?
  !!@default
end

- (Boolean) fixed?

Returns:

  • (Boolean)


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

def fixed?
  !!@fixed
end

- (Boolean) optional?

Returns:

  • (Boolean)


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

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

- (Boolean) required?

Returns:

  • (Boolean)


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

def required?
  @bounds.min > 0
end

- (Boolean) single?

Returns:

  • (Boolean)


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

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