Class: Numeric
- Inherits:
-
Object
show all
- Includes:
- SGML
- Defined in:
- lib/m500.rb
Instance Method Summary
collapse
Methods included from SGML
#tog_sgml_id
Instance Method Details
#coerce(other) ⇒ Object
255
256
257
258
259
260
261
|
# File 'lib/m500.rb', line 255
def coerce(other)
if Natural === other or Counting === other or Zahlen === other or Quotient === other or Fraction === other
[other.to_i,self]
else
super
end
end
|
#irrational? ⇒ Boolean
249
250
251
|
# File 'lib/m500.rb', line 249
def irrational?
false
end
|
#rational? ⇒ Boolean
252
253
254
|
# File 'lib/m500.rb', line 252
def rational?
true
end
|
#sgml_id ⇒ Object
214
215
216
217
218
|
# File 'lib/m500.rb', line 214
def sgml_id
ret = ""
@idsgml ? ret = "id='#{self.class.to_s.downcase}#{self.object_id}' " : ret = ""
ret
end
|
#to_Dec ⇒ Object
237
238
239
|
# File 'lib/m500.rb', line 237
def to_Dec
self
end
|
#to_Frac ⇒ Object
231
232
233
|
# File 'lib/m500.rb', line 231
def to_Frac
self
end
|
#to_K ⇒ Object
243
244
245
|
# File 'lib/m500.rb', line 243
def to_K
self
end
|
#to_N ⇒ Object
222
223
224
|
# File 'lib/m500.rb', line 222
def to_N
self
end
|
#to_N0 ⇒ Object
225
226
227
|
# File 'lib/m500.rb', line 225
def to_N0
self
end
|
#to_Q ⇒ Object
234
235
236
|
# File 'lib/m500.rb', line 234
def to_Q
self
end
|
#to_R ⇒ Object
246
247
248
|
# File 'lib/m500.rb', line 246
def to_R
self
end
|
#to_sgml ⇒ Object
219
220
221
|
# File 'lib/m500.rb', line 219
def to_sgml
"<mn #{sgml_id}class='numeric'>#{self.to_s}</mn>"
end
|
#to_Sig ⇒ Object
240
241
242
|
# File 'lib/m500.rb', line 240
def to_Sig
self
end
|
#to_Z ⇒ Object
228
229
230
|
# File 'lib/m500.rb', line 228
def to_Z
self
end
|