Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.94 KB | None | 0 0
  1. class HtmlDashboardCreatorFactory
  2.  
  3.     def initialize(configurationReader)
  4.       @widgetConfig = configurationReader
  5.     end
  6.  
  7.     def draw
  8.       orientation = @widgetConfig.get_widget_layout_orientation
  9.       layout = @widgetConfig.get_widget_layout_conf
  10.  
  11.       if orientation.eql?("ascending") && layout.eql?("line_by_line")
  12.         AscendingHorizontalLayout.new(@widgetConfig).bindData
  13.       elsif orientation.eql?("ascending") && layout.eql?("column_by_column")
  14.         AscendingVertikalLayout.new(@widgetConfig).bindData
  15.       elsif orientation.eql?("downward") && layout.eql?("line_by_line")
  16.         DownwardHorizontalLayout.new(@widgetConfig).bindData
  17.       elsif orientation.eql?("downward") && layout.eql?("column_by_column")
  18.         DownwardVertikalLayout.new(@widgetConfig).bindData
  19.       else
  20.         raise DashboardError::DrawLayoutError
  21.           .new("The configured layout does not yet exist")
  22.       end
  23.  
  24.     end
  25.  
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement