Module: Svelte

Includes:
ActionView::Helpers::JavaScriptHelper
Defined in:
lib/svelte.rb,
lib/svelte/errors.rb,
lib/svelte/handler.rb,
lib/svelte/helpers.rb,
lib/svelte/railtie.rb,
lib/svelte/version.rb,
lib/svelte/variabilization.rb,
lib/generators/svelte/install_generator.rb

Defined Under Namespace

Modules: Errors, Helpers, Variabilization Classes: Handler, InstallGenerator, Railtie

Constant Summary collapse

DISCARD_PROPS =
%w[lookup_context view_renderer current_template output_buffer view_flow rendered_format marked_for_same_origin_verification virtual_path]
ISLAND_ATTRS =
{
  "on:visible": "",
  "on:idle": ""
}
VERSION =
"0.8.1"

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Svelte)

    the object that the method was called on



14
15
16
# File 'lib/svelte.rb', line 14

def self.configure
  yield(self)
end

.gem_dirObject



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

def self.gem_dir
  Gem::Specification.find_by_name("actionview-svelte-handler").gem_dir
end

.precedence(*args) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/svelte.rb', line 32

def self.precedence(*args)
  args.each do |v|
    if !v.nil?
      return v
    end
  end

  nil
end

.propsObject



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

def self.props
  ActiveSupport::IsolatedExecutionState[:svelte_props] ||= {} # steep:ignore UnknownConstant
end