module PoiseApplication::AppMixin::Resource

A helper mixin for application resources.

Public Instance Methods

app_state() click to toggle source

A delegator for accessing the application state. If no application parent is found, the state will be tracked internally within the resource.

@return [Hash<Symbol, Object>]

# File lib/poise_application/app_mixin.rb, line 48
def app_state
  if parent
    parent.app_state
  else
    # If there isn't a parent, just track within the resource.
    @local_app_state ||= Mash.new
  end
end
app_state_environment() click to toggle source

Environment variables stored in the application state.

@return [Hash<String, String>]

# File lib/poise_application/app_mixin.rb, line 60
def app_state_environment
  app_state[:environment] ||= Mash.new
end