Class: Nio::RepDec::Opt
- Inherits:
-
Object
- Object
- Nio::RepDec::Opt
- Includes:
- StateEquivalent
- Defined in:
- lib/nio/repdec.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#auto_rep ⇒ Object
Returns the value of attribute auto_rep.
-
#begin_rep ⇒ Object
Returns the value of attribute begin_rep.
-
#dec_sep ⇒ Object
Returns the value of attribute dec_sep.
-
#digits ⇒ Object
Returns the value of attribute digits.
-
#end_rep ⇒ Object
Returns the value of attribute end_rep.
-
#grp ⇒ Object
Returns the value of attribute grp.
-
#grp_sep ⇒ Object
Returns the value of attribute grp_sep.
-
#inf_txt ⇒ Object
Returns the value of attribute inf_txt.
-
#max_d ⇒ Object
Returns the value of attribute max_d.
-
#nan_txt ⇒ Object
Returns the value of attribute nan_txt.
Instance Method Summary collapse
- #digits_defined? ⇒ Boolean
-
#initialize ⇒ Opt
constructor
default options.
- #set_delim(begin_d, end_d = '') ⇒ Object
- #set_digits(ds, dncase = false, casesens = false) ⇒ Object
- #set_grouping(sep, g = []) ⇒ Object
- #set_sep(d) ⇒ Object
- #set_special(nan_txt, inf_txt) ⇒ Object
- #set_suffix(a) ⇒ Object
Methods included from StateEquivalent
Constructor Details
#initialize ⇒ Opt
default options
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/nio/repdec.rb', line 60 def initialize() #default options @begin_rep = '<' @end_rep = '>' @auto_rep = '...' @dec_sep = '.' @grp_sep = ',' @grp = [] # [3] for thousands separators @inf_txt = 'Infinity' @nan_txt = 'NaN' @digits = DigitsDef.new @digits_defined = false @max_d = 5000 end |
Instance Attribute Details
#auto_rep ⇒ Object
Returns the value of attribute auto_rep.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def auto_rep @auto_rep end |
#begin_rep ⇒ Object
Returns the value of attribute begin_rep.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def begin_rep @begin_rep end |
#dec_sep ⇒ Object
Returns the value of attribute dec_sep.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def dec_sep @dec_sep end |
#digits ⇒ Object
Returns the value of attribute digits.
124 125 126 |
# File 'lib/nio/repdec.rb', line 124 def digits @digits end |
#end_rep ⇒ Object
Returns the value of attribute end_rep.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def end_rep @end_rep end |
#grp ⇒ Object
Returns the value of attribute grp.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def grp @grp end |
#grp_sep ⇒ Object
Returns the value of attribute grp_sep.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def grp_sep @grp_sep end |
#inf_txt ⇒ Object
Returns the value of attribute inf_txt.
81 82 83 |
# File 'lib/nio/repdec.rb', line 81 def inf_txt @inf_txt end |
#max_d ⇒ Object
Returns the value of attribute max_d.
80 81 82 |
# File 'lib/nio/repdec.rb', line 80 def max_d @max_d end |
#nan_txt ⇒ Object
Returns the value of attribute nan_txt.
81 82 83 |
# File 'lib/nio/repdec.rb', line 81 def nan_txt @nan_txt end |
Instance Method Details
#digits_defined? ⇒ Boolean
125 126 127 |
# File 'lib/nio/repdec.rb', line 125 def digits_defined? @digits_defined end |
#set_delim(begin_d, end_d = '') ⇒ Object
83 84 85 86 87 |
# File 'lib/nio/repdec.rb', line 83 def set_delim(begin_d,end_d='') @begin_rep = begin_d @end_rep = end_d return self end |
#set_digits(ds, dncase = false, casesens = false) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/nio/repdec.rb', line 107 def set_digits(ds, dncase=false, casesens=false) if ds @digits_defined = true if ds.kind_of?(DigitsDef) @digits = ds elsif ds.kind_of?(Numeric) @digits = DigitsDef.base(ds, dncase, casesens) else @digits = DigitsDef.new(ds,casesens) end else @digits = DigitsDef.new @digits_defined = false end self end |
#set_grouping(sep, g = []) ⇒ Object
96 97 98 99 100 |
# File 'lib/nio/repdec.rb', line 96 def set_grouping(sep,g=[]) @grp_sep = a @grp = g return self end |
#set_sep(d) ⇒ Object
92 93 94 95 |
# File 'lib/nio/repdec.rb', line 92 def set_sep(d) @dec_sep = a return self end |
#set_special(nan_txt, inf_txt) ⇒ Object
101 102 103 104 105 |
# File 'lib/nio/repdec.rb', line 101 def set_special(nan_txt, inf_txt) @nan_txt = nan_txt @inf_txt = inf_txt return self end |
#set_suffix(a) ⇒ Object
88 89 90 91 |
# File 'lib/nio/repdec.rb', line 88 def set_suffix(a) @auto_rep = a return self end |