Module: Statsample::NamedMatrix
Overview
Module to add names to X and Y fields
Instance Method Summary collapse
- #fields ⇒ Object
- #fields=(v) ⇒ Object
- #fields_x ⇒ Object
- #fields_x=(v) ⇒ Object
- #fields_y ⇒ Object
- #fields_y=(v) ⇒ Object
- #get_new_name ⇒ Object
- #name ⇒ Object
- #name=(v) ⇒ Object
Methods included from Summarizable
Instance Method Details
#fields ⇒ Object
179 180 181 182 |
# File 'lib/statsample/matrix.rb', line 179 def fields raise "Should be square" if !square? fields_x end |
#fields=(v) ⇒ Object
183 184 185 186 187 |
# File 'lib/statsample/matrix.rb', line 183 def fields=(v) raise "Matrix should be square" if !square? @fields_x=v @fields_y=v end |
#fields_x ⇒ Object
196 197 198 |
# File 'lib/statsample/matrix.rb', line 196 def fields_x @fields_x||=row_size.times.collect {|i| _("X%d") % i} end |
#fields_x=(v) ⇒ Object
188 189 190 191 |
# File 'lib/statsample/matrix.rb', line 188 def fields_x=(v) raise "Size of fields != row_size" if v.size!=row_size @fields_x=v end |
#fields_y ⇒ Object
199 200 201 |
# File 'lib/statsample/matrix.rb', line 199 def fields_y @fields_y||=column_size.times.collect {|i| _("Y%d") % i} end |
#fields_y=(v) ⇒ Object
192 193 194 195 |
# File 'lib/statsample/matrix.rb', line 192 def fields_y=(v) raise "Size of fields != column_size" if v.size!=column_size @fields_y=v end |
#get_new_name ⇒ Object
209 210 211 212 213 |
# File 'lib/statsample/matrix.rb', line 209 def get_new_name @@named_matrix||=0 @@named_matrix+=1 _("Matrix %d") % @@named_matrix end |
#name ⇒ Object
203 204 205 |
# File 'lib/statsample/matrix.rb', line 203 def name @name||=get_new_name end |
#name=(v) ⇒ Object
206 207 208 |
# File 'lib/statsample/matrix.rb', line 206 def name=(v) @name=v end |