Class: React::Rails::HotLoader::AssetPath

Inherits:
Object
  • Object
show all
Defined in:
lib/hot_loader/asset_path.rb

Overview

We want to include different files in dev/prod. The production (dummy) file is empty!

Constant Summary collapse

GEM_LIB_PATH =
Pathname.new('../../').expand_path(__FILE__)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dummy: false) ⇒ AssetPath

Returns a new instance of AssetPath.



11
12
13
14
# File 'lib/hot_loader/asset_path.rb', line 11

def initialize(dummy: false)
  asset_path = dummy ? "assets/dummy": "assets"
  @to_s = File.join(GEM_LIB_PATH, asset_path)
end

Instance Attribute Details

#to_sObject (readonly)

Returns the value of attribute to_s.



9
10
11
# File 'lib/hot_loader/asset_path.rb', line 9

def to_s
  @to_s
end