Class: VBulletin

Inherits:
Object
  • Object
show all
Defined in:
lib/Olib/utils/vbulletin.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVBulletin

Returns a new instance of VBulletin.



3
4
5
6
# File 'lib/Olib/utils/vbulletin.rb', line 3

def initialize
  @post = String.new
  self
end

Instance Attribute Details

#postObject

Returns the value of attribute post.



2
3
4
# File 'lib/Olib/utils/vbulletin.rb', line 2

def post
  @post
end

Class Method Details

.commafy(n) ⇒ Object



95
96
97
# File 'lib/Olib/utils/vbulletin.rb', line 95

def VBulletin.commafy(n)
  n.to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(",").reverse
end

Instance Method Details

#add(str) ⇒ Object



55
56
57
58
# File 'lib/Olib/utils/vbulletin.rb', line 55

def add(str)
  @post.concat str
  self
end

#add_line(str) ⇒ Object



59
60
61
62
# File 'lib/Olib/utils/vbulletin.rb', line 59

def add_line(str)
  @post.concat "#{str}\n"
  self
end

#close_boldObject



19
20
21
22
# File 'lib/Olib/utils/vbulletin.rb', line 19

def close_bold
  @post.concat '[/B]'
  self
end

#close_cellObject



47
48
49
50
# File 'lib/Olib/utils/vbulletin.rb', line 47

def close_cell
  @post.concat '[/TD]'
  self
end

#close_colorObject



51
52
53
54
# File 'lib/Olib/utils/vbulletin.rb', line 51

def close_color
  @post.concat '[/COLOR]'
  self
end

#close_indentObject



83
84
85
86
# File 'lib/Olib/utils/vbulletin.rb', line 83

def close_indent
  @post.concat "[/INDENT]"
  self
end

#close_italicsObject



75
76
77
78
# File 'lib/Olib/utils/vbulletin.rb', line 75

def close_italics
  @post.concat "[/I]"
  self
end

#close_sizeObject



67
68
69
70
# File 'lib/Olib/utils/vbulletin.rb', line 67

def close_size
  @post.concat "[/SIZE]"
  self
end

#close_tableObject



31
32
33
34
# File 'lib/Olib/utils/vbulletin.rb', line 31

def close_table
  @post.concat "[/TABLE]"
  self
end

#close_trObject



39
40
41
42
# File 'lib/Olib/utils/vbulletin.rb', line 39

def close_tr
  @post.contact "[/TR]"
  self
end

#close_underlineObject



15
16
17
18
# File 'lib/Olib/utils/vbulletin.rb', line 15

def close_underline
  @post.concat '[/U]'
  self
end

#enterObject



91
92
93
94
# File 'lib/Olib/utils/vbulletin.rb', line 91

def enter
  @post.concat "\n"
  self
end

#open_boldObject



7
8
9
10
# File 'lib/Olib/utils/vbulletin.rb', line 7

def open_bold
  @post.concat "[B]"
  self
end

#open_cellObject



43
44
45
46
# File 'lib/Olib/utils/vbulletin.rb', line 43

def open_cell
  @post.concat "[TD]"
  self
end

#open_color(hexcode) ⇒ Object



23
24
25
26
# File 'lib/Olib/utils/vbulletin.rb', line 23

def open_color(hexcode)
  @post.concat "[COLOR=\"#{hexcode}\"]"
  self
end

#open_indentObject



79
80
81
82
# File 'lib/Olib/utils/vbulletin.rb', line 79

def open_indent
  @post.concat "[INDENT]"
  self
end

#open_italicsObject



71
72
73
74
# File 'lib/Olib/utils/vbulletin.rb', line 71

def open_italics
  @post.concat"[I]"
  self
end

#open_size(sz) ⇒ Object



63
64
65
66
# File 'lib/Olib/utils/vbulletin.rb', line 63

def open_size(sz)
  @post.concat "[SIZE=#{sz}]"
  self
end

#open_table(width = 500) ⇒ Object



27
28
29
30
# File 'lib/Olib/utils/vbulletin.rb', line 27

def open_table(width=500)
  @post.contat "[TABLE=\"width: #{width}\""
  self
end

#open_trObject



35
36
37
38
# File 'lib/Olib/utils/vbulletin.rb', line 35

def open_tr
  @post.contact "[TR]"
  self
end

#open_underlineObject



11
12
13
14
# File 'lib/Olib/utils/vbulletin.rb', line 11

def open_underline
  @post.concat '[U]'
  self
end

#tabObject



87
88
89
90
# File 'lib/Olib/utils/vbulletin.rb', line 87

def tab
  @post.concat "\t"
  self
end

#to_sObject



98
99
100
# File 'lib/Olib/utils/vbulletin.rb', line 98

def to_s
  @post
end