Class: Cabriolet::Modifier::FileObject

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

Overview

Simple file object for modified files

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, data:, attributes: nil, date: nil, time: nil) ⇒ FileObject

Returns a new instance of FileObject.



257
258
259
260
261
262
263
# File 'lib/cabriolet/modifier.rb', line 257

def initialize(name:, data:, attributes: nil, date: nil, time: nil)
  @name = name
  @data = data
  @attributes = attributes
  @date = date
  @time = time
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



255
256
257
# File 'lib/cabriolet/modifier.rb', line 255

def attributes
  @attributes
end

#dataObject (readonly)

Returns the value of attribute data.



255
256
257
# File 'lib/cabriolet/modifier.rb', line 255

def data
  @data
end

#dateObject (readonly)

Returns the value of attribute date.



255
256
257
# File 'lib/cabriolet/modifier.rb', line 255

def date
  @date
end

#nameObject (readonly)

Returns the value of attribute name.



255
256
257
# File 'lib/cabriolet/modifier.rb', line 255

def name
  @name
end

#timeObject (readonly)

Returns the value of attribute time.



255
256
257
# File 'lib/cabriolet/modifier.rb', line 255

def time
  @time
end

Instance Method Details

#sizeObject



265
266
267
# File 'lib/cabriolet/modifier.rb', line 265

def size
  @data.bytesize
end