Class: Less::Loader::FS::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/less/loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Buffer

Returns a new instance of Buffer.



103
104
105
# File 'lib/less/loader.rb', line 103

def initialize(path)
  @data = File.read(path)
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



101
102
103
# File 'lib/less/loader.rb', line 101

def data
  @data
end

Instance Method Details

#lengthObject



107
108
109
# File 'lib/less/loader.rb', line 107

def length
  @data.length
end

#toString(*args) ⇒ Object



111
112
113
114
115
116
117
# File 'lib/less/loader.rb', line 111

def toString(*args)
  if args.last == "base64"
    Base64.strict_encode64(@data)
  else
    @data
  end
end