ifmb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ifmb/generator.rb +1 -1
- data/lib/ifmb/html_formatter.rb +35 -7
- data/lib/ifmb/version.rb +1 -1
- data/spec/html_formatter_spec.rb +1 -1
- metadata +1 -1
data/lib/ifmb/generator.rb
CHANGED
data/lib/ifmb/html_formatter.rb
CHANGED
@@ -5,15 +5,19 @@ module Ifmb
|
|
5
5
|
@reference = reference
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
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
|
-
|
16
|
-
|
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ão emitido pela caixa automática faz prova de pagamento. Conserve-o.</td>
|
35
39
|
</tr>
|
36
40
|
</table>
|
37
|
-
|
38
|
-
|
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ê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ão emitido pela caixa automá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
|
data/lib/ifmb/version.rb
CHANGED
data/spec/html_formatter_spec.rb
CHANGED
@@ -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.
|
18
|
+
formatter.html.delete(' ').should == formatted_reference(@reference).delete(' ')
|
19
19
|
end
|
20
20
|
|
21
21
|
|