Sha256: 61cf9800d4bedeabf4bf582e4ce0e70f151504f38380b1f91a3e664c4fd7f0cf

Contents?: true

Size: 511 Bytes

Versions: 5

Compression:

Stored size: 511 Bytes

Contents


class Frame
  def initialize
    @dir = File.dirname(__FILE__)
  end

  def get_name_order(name_path)
    if name_path
      return File.basename(name_path, ".txt").to_i
    end
  end

  def get_frames
    frame_files = Dir.glob(File.join(@dir, "frames", "*.txt").to_s)

    frame_files = frame_files.sort do |a, b|
      get_name_order(a) <=> get_name_order(b)
    end

    frame_contents = frame_files.map do |frame_files|
      File.open(frame_files, 'r').read
    end

    return frame_contents
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
firew0rks-0.5.0 lib/firew0rks/frame.rb
firew0rks-0.4.0 lib/firew0rks/frame.rb
firew0rks-0.3.0 lib/firew0rks/frame.rb
firew0rks-0.2.0 lib/firew0rks/frame.rb
firew0rks-0.1.0 lib/firew0rks/frame.rb