Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext.rb

Direct Known Subclasses

Webern::Row

Instance Method Summary (collapse)

Instance Method Details

- (Object) generate_row_from_letters



8
9
10
# File 'lib/core_ext.rb', line 8

def generate_row_from_letters
  self.map{|element| self.sort.index(element) }
end

- (Boolean) is_all_integers?

Returns:

  • (Boolean)


2
3
4
5
6
# File 'lib/core_ext.rb', line 2

def is_all_integers?
  self.all?{|element| element.to_i.to_s == element }
rescue Exception
  false
end