Sha256: 17dc3e5694d08ebd4836f585f706873b19b0d7687eff3fe6f561b1bb7308fb8f

Contents?: true

Size: 383 Bytes

Versions: 6

Compression:

Stored size: 383 Bytes

Contents

# frozen_string_literal: true

require "stashify"

module Stashify
  class File
    attr_reader :name, :contents

    def initialize(name:, contents: "")
      raise Stashify::InvalidFile, "Name '#{name}' contains a /" if name =~ %r{/}

      @name = name
      @contents = contents
    end

    def ==(other)
      name == other.name && contents == other.contents
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stashify-1.0.5 lib/stashify/file.rb
stashify-1.0.4 lib/stashify/file.rb
stashify-1.0.3 lib/stashify/file.rb
stashify-1.0.2 lib/stashify/file.rb
stashify-1.0.1 lib/stashify/file.rb
stashify-1.0 lib/stashify/file.rb