class ADIWG::Mdtranslator::Writers::Html::Html_Responsibility

Public Class Methods

new(html) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_responsibility.rb, line 17
def initialize(html)
   @html = html
end

Public Instance Methods

writeHtml(hResponsibility) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_responsibility.rb, line 21
def writeHtml(hResponsibility)

   # classes used
   extentClass = Html_Extent.new(@html)

   # responsibility - role parties
   hResponsibility[:parties].each do |hParty|
      hContact = Html_Document.getContact(hParty[:contactId])
      @html.details do
         @html.summary(hContact[:name], 'class' => 'h5')
         @html.section(:class => 'block') do

            # party - contact ID
            @html.em('Contact ID: ')
            @html.a(hContact[:contactId], 'href' => '#CID_'+hContact[:contactId])
            @html.br

            # party - contact type
            unless hContact[:contactType].nil?
               @html.em('Contact Type: ')
               @html.text!(hContact[:contactType])
               @html.br
            end

            if hContact[:isOrganization]
               hParty[:organizationMembers].each do |memberId|
                  hMemberContact = Html_Document.getContact(memberId)
                  @html.em('has Member: ')
                  @html.a(hMemberContact[:name], 'href' => '#CID_'+ memberId)
                  @html.br
               end
            else
               hMemberContact = Html_Document.getContact(hContact[:contactId])
               unless hMemberContact[:positionName].nil?
                  @html.em('Position Name: ')
                  @html.text!(hMemberContact[:positionName])
                  @html.br
               end
            end

         end
      end
   end

   # responsibility - role extent [] {extent}
   hResponsibility[:roleExtents].each do |hExtent|
      @html.details do
         @html.summary('Extent', {'class' => 'h5'})
         @html.section(:class => 'block') do
            extentClass.writeHtml(hExtent)
         end
      end
   end

end