Class: Awspec::Generator::Doc::Type::AccountAttributeBase

Inherits:
Base
  • Object
show all
Defined in:
lib/awspec/generator/doc/type/account_attribute_base.rb

Instance Method Summary collapse

Methods inherited from Base

#collect_matchers, #generate_doc, #sort_num, #type_name

Constructor Details

#initializeAccountAttributeBase

Returns a new instance of AccountAttributeBase.



5
6
7
8
# File 'lib/awspec/generator/doc/type/account_attribute_base.rb', line 5

def initialize
  Awspec::Stub.load 'account'
  @type_name = type_name
end

Instance Method Details

#doc_templateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/awspec/generator/doc/type/account_attribute_base.rb', line 10

def doc_template
  template = <<-'EOF'
## <a name="<%= @type_name.gsub(/ /, '_').underscore %>"><%= @type_name.gsub(/ /, '_').underscore %></a>

<%= @type_name %> account attributes.
<%- if @descriptions.include?('first') -%><%= @descriptions['first'] %><%- end -%>
<% @matchers.each do |matcher| %>
### <%= matcher %>
<%- if @descriptions.include?(matcher) -%><%= @descriptions[matcher] %><%- end -%>
<% end %>
<%- unless its.empty? -%>### <%= its.join(', ') %><%- end -%>
<%- if @descriptions.include?('advanced') -%>

### :unlock: Advanced use
<%= @descriptions['advanced'] %><%- end -%>

EOF
  template
end