Skip to content

Commit

Permalink
Correct white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jungrafael committed Oct 7, 2015
1 parent f914b83 commit 2192897
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 59 deletions.
16 changes: 8 additions & 8 deletions lib/report/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ def size hash = nil
end

def obtain_png_file
blob = obtain_png_blob
blob = obtain_png_blob

file = Tempfile.new('image')
file.binmode
file.write blob
file.flush
file.close
file = Tempfile.new('image')
file.binmode
file.write blob
file.flush
file.close

return file.path
end
return file.path
end

private

Expand Down
102 changes: 51 additions & 51 deletions lib/report/report.rb
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
require 'tempfile'

module Report
class Report
def initialize
@report_data = Array.new
@image = nil
@header = nil
class Report
def initialize
@report_data = Array.new
@image = nil
@header = nil

yield self
end
yield self
end

def header
header = Header.new
yield header
@header = header
end
def header
header = Header.new
yield header
@header = header
end

def add_title
title = Title.new
yield title
add_to_report(title)
end
def add_title
title = Title.new
yield title
add_to_report(title)
end

def add_subtitle
subtitle = Subtitle.new
yield subtitle
add_to_report(subtitle)
end
def add_subtitle
subtitle = Subtitle.new
yield subtitle
add_to_report(subtitle)
end

def add_paragraph
paragraph = Paragraph.new
yield paragraph
add_to_report(paragraph)
end
def add_paragraph
paragraph = Paragraph.new
yield paragraph
add_to_report(paragraph)
end

def line_break
nl = TextBlock.new
add_to_report(nl)
end
def line_break
nl = TextBlock.new
add_to_report(nl)
end

def add_table(dimension_x, dimension_y)
table = Table.new(dimension_x, dimension_y)
yield table
add_to_report(table)
end
def add_table(dimension_x, dimension_y)
table = Table.new(dimension_x, dimension_y)
yield table
add_to_report(table)
end

def add_image
if block_given?
image = Image.new
yield image
add_to_report(image)
end
end
def add_image
if block_given?
image = Image.new
yield image
add_to_report(image)
end
end

def generate_report
raise 'Error: Function not implemented'
end
def generate_report
raise 'Error: Function not implemented'
end

private
def add_to_report (data)
@report_data.push(data)
end
end
private
def add_to_report (data)
@report_data.push(data)
end
end
end

0 comments on commit 2192897

Please sign in to comment.