Class: AssetsInclude::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/assets_include/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
15
16
17
18
# File 'lib/assets_include/base.rb', line 9

def initialize(options = {})
  @cache = Cache.new
  @config = default_assets_location
  @bundled = production?
  @cache_boosters = true

  options.each do |key, value|
    public_send("#{key}=", value)
  end
end

Instance Attribute Details

#asset_hostsObject

Returns the value of attribute asset_hosts.



6
7
8
# File 'lib/assets_include/base.rb', line 6

def asset_hosts
  @asset_hosts
end

#binaryObject

Returns the value of attribute binary.



7
8
9
# File 'lib/assets_include/base.rb', line 7

def binary
  @binary
end

#bundledObject

Returns the value of attribute bundled.



6
7
8
# File 'lib/assets_include/base.rb', line 6

def bundled
  @bundled
end

#cache_boostersObject

Returns the value of attribute cache_boosters.



6
7
8
# File 'lib/assets_include/base.rb', line 6

def cache_boosters
  @cache_boosters
end

#configObject

Returns the value of attribute config.



6
7
8
# File 'lib/assets_include/base.rb', line 6

def config
  @config
end

#rootObject

Returns the value of attribute root.



6
7
8
# File 'lib/assets_include/base.rb', line 6

def root
  @root
end

Instance Method Details

#group(locator, options = {}) ⇒ Object



20
21
22
# File 'lib/assets_include/base.rb', line 20

def group(locator, options = {})
  assets(locator, options)
end

#inline(locator) ⇒ Object



28
29
30
# File 'lib/assets_include/base.rb', line 28

def inline(locator)
  assets(locator, inline: true)
end

#list(locator) ⇒ Object



24
25
26
# File 'lib/assets_include/base.rb', line 24

def list(locator)
  assets(locator, list: true).strip.split(',')
end

#resetObject



32
33
34
# File 'lib/assets_include/base.rb', line 32

def reset
  cache.empty
end