Class: Crashdesk::Environment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Environment

Returns a new instance of Environment.



9
10
11
12
# File 'lib/crashdesk/environment.rb', line 9

def initialize(args)
  self.project_root = args[:project_root]
  self.environment_name = args[:environment_name]
end

Instance Attribute Details

#environment_nameObject

Returns the value of attribute environment_name.



7
8
9
# File 'lib/crashdesk/environment.rb', line 7

def environment_name
  @environment_name
end

#framework_stringObject (readonly)

Returns the value of attribute framework_string.



7
8
9
# File 'lib/crashdesk/environment.rb', line 7

def framework_string
  @framework_string
end

#project_rootObject

Returns the value of attribute project_root.



7
8
9
# File 'lib/crashdesk/environment.rb', line 7

def project_root
  @project_root
end

Instance Method Details

#to_hashObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/crashdesk/environment.rb', line 14

def to_hash
  {
    :project_root => project_root,
    :environment_name => environment_name,
    :hostname => Socket.gethostname,
    :language => 'ruby',
    :language_version => RUBY_VERSION,
    :language_platform => RUBY_PLATFORM
  }
end