Class: Hotwire::Spark::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/hotwire/spark/change.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(monitored_paths, extensions, changed_path, action) ⇒ Change

Returns a new instance of Change.



4
5
6
7
8
9
# File 'lib/hotwire/spark/change.rb', line 4

def initialize(monitored_paths, extensions, changed_path, action)
  @monitored_paths = monitored_paths
  @extensions = extensions
  @changed_path = changed_path
  @action = action
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



2
3
4
# File 'lib/hotwire/spark/change.rb', line 2

def action
  @action
end

#changed_pathObject (readonly)

Returns the value of attribute changed_path.



2
3
4
# File 'lib/hotwire/spark/change.rb', line 2

def changed_path
  @changed_path
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



2
3
4
# File 'lib/hotwire/spark/change.rb', line 2

def extensions
  @extensions
end

#monitored_pathsObject (readonly)

Returns the value of attribute monitored_paths.



2
3
4
# File 'lib/hotwire/spark/change.rb', line 2

def monitored_paths
  @monitored_paths
end

Instance Method Details

#broadcastObject



11
12
13
# File 'lib/hotwire/spark/change.rb', line 11

def broadcast
  broadcast_reload_action if should_broadcast?
end