Class: JefferiesTube::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jefferies_tube.rb', line 21

def initialize
  if defined?(Rails)
    @environment = ::Rails.env.downcase || nil
    @prompt_name =
      if ::Rails::VERSION::MAJOR >= 6
        ::Rails.application.class.module_parent_name || nil
      else
        ::Rails.application.class.parent_name || nil
      end
  else
    @environment = "development"
    @prompt_name = "JefferiesTube"
  end
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



18
19
20
# File 'lib/jefferies_tube.rb', line 18

def environment
  @environment
end

#prompt_nameObject

Returns the value of attribute prompt_name.



19
20
21
# File 'lib/jefferies_tube.rb', line 19

def prompt_name
  @prompt_name
end