Class: WsdlMapper::Dom::Attribute

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

Defined Under Namespace

Classes: Ref

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type_name, default: nil, use: nil, fixed: nil, form: nil) ⇒ Attribute

Returns a new instance of Attribute.



16
17
18
19
20
21
22
23
# File 'lib/wsdl_mapper/dom/attribute.rb', line 16

def initialize(name, type_name, default: nil, use: nil, fixed: nil, form: nil)
  @name, @type_name = name, type_name
  @documentation = Documentation.new
  @default = default
  @use = use
  @fixed = fixed
  @form = form
end

Instance Attribute Details

#containing_typeObject

Returns the value of attribute containing_type.



14
15
16
# File 'lib/wsdl_mapper/dom/attribute.rb', line 14

def containing_type
  @containing_type
end

#defaultObject (readonly)

Returns the value of attribute default.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def default
  @default
end

#documentationObject

Returns the value of attribute documentation.



13
14
15
# File 'lib/wsdl_mapper/dom/attribute.rb', line 13

def documentation
  @documentation
end

#fixedObject (readonly)

Returns the value of attribute fixed.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def fixed
  @fixed
end

#formObject (readonly)

Returns the value of attribute form.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def form
  @form
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def name
  @name
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/wsdl_mapper/dom/attribute.rb', line 12

def type
  @type
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def type_name
  @type_name
end

#useObject (readonly)

Returns the value of attribute use.



11
12
13
# File 'lib/wsdl_mapper/dom/attribute.rb', line 11

def use
  @use
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/wsdl_mapper/dom/attribute.rb', line 25

def default?
  !!@default
end

#fixed?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/wsdl_mapper/dom/attribute.rb', line 29

def fixed?
  !!@fixed
end

#optional?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/wsdl_mapper/dom/attribute.rb', line 33

def optional?
  @use == 'optional'
end

#required?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/wsdl_mapper/dom/attribute.rb', line 37

def required?
  @use == 'required'
end