Method: WSDSL::Response::Element#initialize

Defined in:
lib/response.rb

#initialize(name, type = nil) ⇒ Element

param [String, Symbol] name The name of the element param [String, Symbol] type The optional type of the element

Since:

  • 0.0.3



147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/response.rb', line 147

def initialize(name, type=nil)
  # sets a documentation placeholder since the response doc is defined at the same time
  # the response is defined.
  @doc        = Documentation::ElementDoc.new(name)
  @name       = name
  @type       = type
  @attributes = []
  @meta_attributes = []
  @vectors    = []
  @key        = nil
  # we don't need to initialize the nested elements, by default they should be nil
end