Class: Array

Inherits:
Object show all
Defined in:
lib/overwrite.rb

Instance Method Summary collapse

Instance Method Details

#sum_sizeInteger

Sum up the size of single arrays in an array of arrays


179
180
181
182
183
184
185
186
187
# File 'lib/overwrite.rb', line 179

def sum_size
  self.inject(0) { |s,a|
    if a.respond_to?('size')
      s+=a.size
    else
      internal_server_error "No size available: #{a.inspect}"
    end
  }
end

#zero_variance?Boolean

For symbolic features


192
193
194
# File 'lib/overwrite.rb', line 192

def zero_variance?
  return self.uniq.size == 1
end