ifmb 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -113,7 +113,7 @@ module Ifmb
113
113
  private
114
114
 
115
115
  def render_html
116
- HtmlFormatter.new(result).output
116
+ HtmlFormatter.new(result).html
117
117
  end
118
118
 
119
119
  def result
@@ -5,15 +5,19 @@ module Ifmb
5
5
  @reference = reference
6
6
  end
7
7
 
8
- def output
8
+ def html
9
9
  formatted_reference
10
10
  end
11
11
 
12
+ def small_html
13
+ formatted_reference_small
14
+ end
15
+
12
16
  private
13
17
 
14
18
  def formatted_reference
15
- '<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
16
- <table cellpadding="3" width="300px" cellspacing="0" style="margin-top: 10px;border: 1px solid #45829F; background-color: #FFFFFF;" align="center">
19
+ '<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
20
+ <table cellpadding="3" width="300px" cellspacing="0" style="margin-top: 10px;border: 1px solid #45829F; background-color: #FFFFFF;" align="center">
17
21
  <tr>
18
22
  <td style="font-size: x-small; border-top: 0px; border-left: 0px; border-right: 0px; border-bottom: 1px solid #45829F; background-color: #45829F; color: White" colspan="3"><div align="center">Pagamento por Multibanco ou Homebanking</div></td>
19
23
  </tr>
@@ -34,10 +38,34 @@ module Ifmb
34
38
  <td style="font-size: xx-small;border-top: 1px solid #45829F; border-left: 0px; border-right: 0px; border-bottom: 0px; background-color: #45829F; color: White" colspan="3">O tal&atilde;o emitido pela caixa autom&aacute;tica faz prova de pagamento. Conserve-o.</td>
35
39
  </tr>
36
40
  </table>
37
- </div>'
38
- end
41
+ </div>'
42
+ end
39
43
 
44
+ def formatted_reference_small
45
+ '<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
46
+ <table cellpadding="3" width="200px" cellspacing="0" style="margin-top: 10px;border: 1px solid #45829F; background-color: #FFFFFF;" align="center">
47
+ <tr>
48
+ <td><div align="center"><img src="http://img412.imageshack.us/img412/9672/30239592.jpg" alt="" width="52" height="60"/></div></td>
49
+ <td style="font-size: x-small; border-top: 0px; border-left: 0px; border-right: 0px; border-bottom: 1px solid #45829F; background-color: #45829F; color: White" colspan="3"><div align="center">Pagamento por Multibanco ou Homebanking</div></td>
50
+ </tr>
51
+ <tr>
52
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Entidade:</td>
53
+ <td style="font-size: x-small; text-align:left">'+@reference.entidade.to_s+'</td>
54
+ </tr>
55
+ <tr>
56
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Refer&ecirc;ncia:</td>
57
+ <td style="font-size: x-small; text-align:left">'+@reference.referencia.to_s+'</td>
58
+ </tr>
59
+ <tr>
60
+ <td style="font-size: x-small; font-weight:bold; text-align:left">Valor:</td>
61
+ <td style="font-size: x-small; text-align:left">'+@reference.order_value.to_s+'</td>
62
+ </tr>
63
+ <tr>
64
+ <td style="font-size: xx-small;border-top: 1px solid #45829F; border-left: 0px; border-right: 0px; border-bottom: 0px; background-color: #45829F; color: White" colspan="3">O tal&atilde;o emitido pela caixa autom&aacute;tica faz prova de pagamento. Conserve-o.</td>
65
+ </tr>
66
+ </table>
67
+ </div>'
68
+ end
40
69
 
41
70
  end
42
-
43
- end
71
+ end
@@ -1,3 +1,3 @@
1
1
  module Ifmb
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -15,7 +15,7 @@ describe Ifmb::HtmlFormatter do
15
15
 
16
16
  it "formats a given reference information" do
17
17
  formatter = H.new @reference
18
- formatter.output.should == formatted_reference(@reference)
18
+ formatter.html.delete(' ').should == formatted_reference(@reference).delete(' ')
19
19
  end
20
20
 
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ifmb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: