Sha256: 5fa43a08b47a3c8d943ffc0341fb3c12bed1e8ec7d5e8bc88830b5657d4cd2a8

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

# Define the way to generate a textual representation of the system
class Phenomenal::Viewer::Textual
  attr_reader :manager, :rmanager
  
  def initialize()
    @manager=Phenomenal::Manager.instance
    @rmanager=Phenomenal::RelationshipManager.instance
  end
  
  def generate()
    str=""
    offset="  "
    self.manager.contexts.each do |key,context|
      if context.is_a?(Phenomenal::Feature)
        type="Feature"
        str=str+"#{type}: #{context.to_s} \n"
        context.relationships.each do |relationship|
          if relationship.is_a?(Phenomenal::Implication)
            relation="=>"
          elsif relationship.is_a?(Phenomenal::Suggestion)
            relation="->"
          elsif relationship.is_a?(Phenomenal::Requirement)
            relation="=<"
          else
            relation="??"
          end
          str=str+"#{offset} #{relationship.source.to_s} #{relation} #{relationship.target.to_s} \n"
       end
     else
       type="Context"
       str=str+"#{type}: #{context.to_s} \n"
     end
   end
     str
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phenomenal-1.2.4 lib/phenomenal/viewer/textual.rb
phenomenal-1.2.3 lib/phenomenal/viewer/textual.rb
phenomenal-1.2.2 lib/phenomenal/viewer/textual.rb
phenomenal-1.2.1 lib/phenomenal/viewer/textual.rb