Module: Ruuuby::Feature::Includable::StringF21

Included in:
String
Defined in:
lib/ruuuby/class/str/str.rb

Overview

defines the operations needed to support Feature(f21) that are applied to Class(String)

Instance Method Summary collapse

Instance Method Details

#digit?Boolean

Returns true, if this String is length 1 with a it’s character being a digit (ascii value between 48 and 57).

Returns:

  • (Boolean)

    true, if this String is length 1 with a it’s character being a digit (ascii value between 48 and 57)



174
# File 'lib/ruuuby/class/str/str.rb', line 174

def digit?; self.

#to_numNumeric, ...

Returns:

Raises:

  • (ArgumentError)


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/ruuuby/class/str/str.rb', line 187

def to_num
  if 

#to_num?Boolean

Returns true, if this String can be converted into a number w/o raising any exception.

Returns:

  • (Boolean)

    true, if this String can be converted into a number w/o raising any exception



177
178
179
180
181
182
# File 'lib/ruuuby/class/str/str.rb', line 177

def to_num?
  self.to_num
  true
rescue
  false
end