Class: QString
Overview
Copyright © 2010-2011 Jesse Sielaff
Constant Summary
Constants inherited
from Q_Object
Q_Object::Subclasses
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from QObject
#and, #array?, #block?, #break_if, #break_unless, #choose, #class?, #dup, #dynamic?, #eq?, #eqq?, #false?, #hash?, #if, #jump_if, #jump_unless, #module?, #neq?, #nil?, #not, #number?, #or, #same?, #tally, #time?, #token?, #true?, #unless, #use, #xor
Methods inherited from Q_Object
class_name, #env, inherited, #initialize, method_added, method_names, #to_q, #to_qliteral, #value
Constructor Details
This class inherits a constructor from Q_Object
Class Method Details
.from_s(string) ⇒ Object
7
8
9
|
# File 'lib/q-language/methods/string.rb', line 7
def QString.from_s (string)
string
end
|
Instance Method Details
#add(string) ⇒ Object
11
12
13
|
# File 'lib/q-language/methods/string.rb', line 11
def add (string)
value + string
end
|
#add_all(*every_string) ⇒ Object
15
16
17
|
# File 'lib/q-language/methods/string.rb', line 15
def add_all (*every_string)
value + every_string.join('')
end
|
#at(number) ⇒ Object
19
20
21
|
# File 'lib/q-language/methods/string.rb', line 19
def at (number)
value.slice(number)
end
|
#between?(string_1, string_2) ⇒ Boolean
23
24
25
|
# File 'lib/q-language/methods/string.rb', line 23
def between? (string_1, string_2)
value.between?(string_1, string_2)
end
|
#capitalize ⇒ Object
27
28
29
|
# File 'lib/q-language/methods/string.rb', line 27
def capitalize
value.capitalize
end
|
#capitalize! ⇒ Object
31
32
33
|
# File 'lib/q-language/methods/string.rb', line 31
def capitalize!
value.capitalize!
end
|
#clear ⇒ Object
35
36
37
|
# File 'lib/q-language/methods/string.rb', line 35
def clear
value.clear
end
|
#downcase ⇒ Object
39
40
41
|
# File 'lib/q-language/methods/string.rb', line 39
def downcase
value.downcase
end
|
#downcase! ⇒ Object
43
44
45
|
# File 'lib/q-language/methods/string.rb', line 43
def downcase!
value.downcase!
end
|
#each(&block) ⇒ Object
47
48
49
50
51
52
|
# File 'lib/q-language/methods/string.rb', line 47
def each (&block)
value.each_char do |obj|
result = yield obj
break result if env::break?
end
end
|
#each_line(&block) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/q-language/methods/string.rb', line 54
def each_line (&block)
value.each_line do |obj|
result = yield obj
break result if env::break?
end
end
|
#empty? ⇒ Boolean
61
62
63
|
# File 'lib/q-language/methods/string.rb', line 61
def empty?
value.empty?
end
|
#end_with?(string) ⇒ Boolean
65
66
67
|
# File 'lib/q-language/methods/string.rb', line 65
def end_with? (string)
value.end_with? string
end
|
#include?(string) ⇒ Boolean
69
70
71
|
# File 'lib/q-language/methods/string.rb', line 69
def include? (string)
value.include? string
end
|
#index(string) ⇒ Object
73
74
75
|
# File 'lib/q-language/methods/string.rb', line 73
def index (string)
value.index(string)
end
|
#length ⇒ Object
77
78
79
|
# File 'lib/q-language/methods/string.rb', line 77
def length
value.length
end
|
#next ⇒ Object
81
82
83
|
# File 'lib/q-language/methods/string.rb', line 81
def next
value.next
end
|
#next! ⇒ Object
85
86
87
|
# File 'lib/q-language/methods/string.rb', line 85
def next!
value.next!
end
|
#partition(string) ⇒ Object
89
90
91
|
# File 'lib/q-language/methods/string.rb', line 89
def partition (string)
value.partition(string)
end
|
#push(string) ⇒ Object
93
94
95
|
# File 'lib/q-language/methods/string.rb', line 93
def push (string)
value << string
end
|
#push_all(*every_string) ⇒ Object
97
98
99
|
# File 'lib/q-language/methods/string.rb', line 97
def push_all (*every_string)
value << every_string.join('')
end
|
#replace(string) ⇒ Object
101
102
103
|
# File 'lib/q-language/methods/string.rb', line 101
def replace (string)
value.replace(string)
end
|
#reverse ⇒ Object
105
106
107
|
# File 'lib/q-language/methods/string.rb', line 105
def reverse
value.reverse
end
|
#reverse! ⇒ Object
109
110
111
|
# File 'lib/q-language/methods/string.rb', line 109
def reverse!
value.reverse!
end
|
#split(string) ⇒ Object
113
114
115
|
# File 'lib/q-language/methods/string.rb', line 113
def split (string)
value.split(string)
end
|
#start_with?(string) ⇒ Boolean
117
118
119
|
# File 'lib/q-language/methods/string.rb', line 117
def start_with? (string)
value.start_with? string
end
|
#string? ⇒ Boolean
121
122
123
|
# File 'lib/q-language/methods/string.rb', line 121
def string?
value
end
|
#stringify ⇒ Object
125
126
127
|
# File 'lib/q-language/methods/string.rb', line 125
def stringify
value.dup
end
|
#strip ⇒ Object
129
130
131
|
# File 'lib/q-language/methods/string.rb', line 129
def strip
value.strip
end
|
#strip! ⇒ Object
133
134
135
136
|
# File 'lib/q-language/methods/string.rb', line 133
def strip!
value.strip!
value
end
|
#swapcase ⇒ Object
138
139
140
|
# File 'lib/q-language/methods/string.rb', line 138
def swapcase
value.swapcase
end
|
#swapcase! ⇒ Object
142
143
144
|
# File 'lib/q-language/methods/string.rb', line 142
def swapcase!
value.swapcase!
end
|
#tokenize ⇒ Object
146
147
148
|
# File 'lib/q-language/methods/string.rb', line 146
def tokenize
value.to_sym
end
|
#upcase ⇒ Object
150
151
152
|
# File 'lib/q-language/methods/string.rb', line 150
def upcase
value.upcase
end
|
#upcase! ⇒ Object
154
155
156
|
# File 'lib/q-language/methods/string.rb', line 154
def upcase!
value.upcase!
end
|