Class: OpenApi::Xml

Inherits:
Object
  • Object
show all
Defined in:
lib/open_api/xml.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, namespace: nil, prefix: nil, attribute: false, wrapped: false) ⇒ Xml

Returns a new instance of Xml.



6
7
8
9
10
11
12
# File 'lib/open_api/xml.rb', line 6

def initialize(name: nil, namespace: nil, prefix: nil, attribute: false, wrapped: false)
  self.name = name
  self.namespace = namespace
  self.prefix = prefix
  self.attribute = attribute
  self.wrapped = wrapped
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



4
5
6
# File 'lib/open_api/xml.rb', line 4

def attribute
  @attribute
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/open_api/xml.rb', line 4

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace.



4
5
6
# File 'lib/open_api/xml.rb', line 4

def namespace
  @namespace
end

#prefixObject

Returns the value of attribute prefix.



4
5
6
# File 'lib/open_api/xml.rb', line 4

def prefix
  @prefix
end

#wrappedObject

Returns the value of attribute wrapped.



4
5
6
# File 'lib/open_api/xml.rb', line 4

def wrapped
  @wrapped
end

Class Method Details

.load(hash) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/open_api/xml.rb', line 14

def self.load(hash)
  return unless hash

  new(
    name: hash["name"],
    namespace: hash["namespace"],
    prefix: hash["prefix"],
    attribute: hash["attribute"],
    wrapped: hash["wrapped"],
  )
end