Class: Nio::RepDec::Opt

Inherits:
Object
  • Object
show all
Includes:
StateEquivalent
Defined in:
lib/nio/repdec.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StateEquivalent

#==, #===, #eql?, #hash

Constructor Details

#initializeOpt

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_repObject

Returns the value of attribute auto_rep.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def auto_rep
  @auto_rep
end

#begin_repObject

Returns the value of attribute begin_rep.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def begin_rep
  @begin_rep
end

#dec_sepObject

Returns the value of attribute dec_sep.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def dec_sep
  @dec_sep
end

#digitsObject

Returns the value of attribute digits.



124
125
126
# File 'lib/nio/repdec.rb', line 124

def digits
  @digits
end

#end_repObject

Returns the value of attribute end_rep.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def end_rep
  @end_rep
end

#grpObject

Returns the value of attribute grp.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def grp
  @grp
end

#grp_sepObject

Returns the value of attribute grp_sep.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def grp_sep
  @grp_sep
end

#inf_txtObject

Returns the value of attribute inf_txt.



81
82
83
# File 'lib/nio/repdec.rb', line 81

def inf_txt
  @inf_txt
end

#max_dObject

Returns the value of attribute max_d.



80
81
82
# File 'lib/nio/repdec.rb', line 80

def max_d
  @max_d
end

#nan_txtObject

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

Returns:

  • (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