Class: Array

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

Overview

A small add-on to the Array class, to make it easy to convert to frame specifications.

Direct Known Subclasses

CTioga::SpecialArray

Instance Method Summary collapse

Instance Method Details

#to_frame(spec = "%s") ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/CTioga/boundaries.rb', line 20

def to_frame(spec = "%s")
  i = 0
  h = {}
  for side in %w(left right top bottom)
    h[ spec % side] = self[i]
    i += 1
  end
  return h
end