Class: Passbook::StaticFile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, path) ⇒ StaticFile

Returns a new instance of StaticFile.



7
8
9
# File 'lib/passbook/static_file.rb', line 7

def initialize(name, path)
  @filename, @path = name, Pathname(path)
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/passbook/static_file.rb', line 5

def filename
  @filename
end

Instance Method Details

#contentObject



11
12
13
# File 'lib/passbook/static_file.rb', line 11

def content
  @content ||= @path.read
end