Class: AssetPocket::Pocket::Definitions

Inherits:
Object
  • Object
show all
Defined in:
lib/asset_pocket/pocket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pocket, filename) ⇒ Definitions

Returns a new instance of Definitions.



56
57
58
59
60
61
62
# File 'lib/asset_pocket/pocket.rb', line 56

def initialize(pocket, filename)
    @pocket = pocket
    @content = []
    @filename = filename
    @compressor = nil
    @separator = ""
end

Instance Attribute Details

#compressorObject (readonly)

Returns the value of attribute compressor.



54
55
56
# File 'lib/asset_pocket/pocket.rb', line 54

def compressor
  @compressor
end

#contentObject (readonly)

Returns the value of attribute content.



54
55
56
# File 'lib/asset_pocket/pocket.rb', line 54

def content
  @content
end

#filenameObject (readonly)

Returns the value of attribute filename.



54
55
56
# File 'lib/asset_pocket/pocket.rb', line 54

def filename
  @filename
end

#pocketObject (readonly)

Returns the value of attribute pocket.



54
55
56
# File 'lib/asset_pocket/pocket.rb', line 54

def pocket
  @pocket
end

Instance Method Details

#compress(name, options = {}) ⇒ Object



80
81
82
# File 'lib/asset_pocket/pocket.rb', line 80

def compress(name, options = {})
    @compressor = AssetPocket::Compressor.parse name, options
end

#full_filenameObject



64
65
66
# File 'lib/asset_pocket/pocket.rb', line 64

def full_filename
    pocket.generator.root_path.join filename
end

#post_process(generated_content) ⇒ Object



89
90
91
# File 'lib/asset_pocket/pocket.rb', line 89

def post_process(generated_content)
    generated_content
end

#processObject



68
69
70
# File 'lib/asset_pocket/pocket.rb', line 68

def process
    :create_file
end

#separator(new_value = nil) ⇒ Object



84
85
86
87
# File 'lib/asset_pocket/pocket.rb', line 84

def separator(new_value = nil)
    @separator = new_value unless new_value.nil?
    @separator
end

#use(pattern) ⇒ Object



76
77
78
# File 'lib/asset_pocket/pocket.rb', line 76

def use(pattern)
    @content << [ :pattern, pattern ]
end

#use_compressor?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/asset_pocket/pocket.rb', line 72

def use_compressor?
    @compressor
end