Class: Relay::Routes::Base

Inherits:
Object
  • Object
show all
Includes:
Concerns::Attachment, Concerns::Context, Concerns::Roda, Concerns::View, Models
Defined in:
app/routes/base.rb

Instance Method Summary collapse

Methods included from Concerns::View

#cancellable?, #context_window, #format_cost, #format_name, #initials, #markdown, #status_bar

Methods included from Concerns::Roda

#initialize, #method_missing, #r, #respond_to_missing?

Methods included from Concerns::Context

#contexts, #ctx, #current_context, #default_context, #default_model, #llm, #llms, #mcps, #model, #models, #normalize_model, #provider, #sync_context!, #user, #valid_model?

Methods included from Concerns::Attachment

#attachment

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Relay::Concerns::Roda

Instance Method Details

#cacheRelay::InMemoryCache

Returns:

  • (Relay::InMemoryCache)


27
28
29
# File 'app/routes/base.rb', line 27

def cache
  Relay.cache
end

#htmx?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/routes/base.rb', line 31

def htmx?
  request.env["HTTP_HX_REQUEST"] == "true"
end

#paramsHash

Returns a Hash or Hash-like object of request parameters

Returns:

  • (Hash)


21
22
23
# File 'app/routes/base.rb', line 21

def params
  request.params
end

#rootString

Returns the root path

Returns:

  • (String)

    Returns the root path



14
15
16
# File 'app/routes/base.rb', line 14

def root
  @root ||= File.join __dir__, "..", ".."
end