Class: WSDSL::Documentation::ElementDoc

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

Overview

This class contains the documentation information regarding an element. Currently, elements are only used in the response info.

Since:

  • 0.0.3

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ElementDoc

Returns a new instance of ElementDoc.

Parameters:

  • The (String)

    element’s name

Since:

  • 0.0.3



33
34
35
36
37
# File 'lib/documentation.rb', line 33

def initialize(name)
  # raise ArgumentError, "An Element doc needs to be initialize by passing a hash with a ':name' keyed entry." unless opts.is_a?(Hash) && opts.has_key?(:name)
  @name       = name
  @attributes = {}
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 0.0.3



29
30
31
# File 'lib/documentation.rb', line 29

def attributes
  @attributes
end

#nameObject (readonly)

Since:

  • 0.0.3



29
30
31
# File 'lib/documentation.rb', line 29

def name
  @name
end

Instance Method Details

#attribute(name, desc) ⇒ Object

Parameters:

  • name (String)

    The name of the attribute described

  • desc (String)

    The description of the attribute

Since:

  • 0.0.3



42
43
44
# File 'lib/documentation.rb', line 42

def attribute(name, desc)
  @attributes[name] = desc
end