Class: DeadCodeTerminator::Cond::EnvIndex
- Defined in:
- lib/dead_code_terminator/cond/env_index.rb
Overview
ENV s(:index,
s(:const, nil, :ENV),
s(:str, "PRODUCTION"))
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from DeadCodeTerminator::Cond::Base
Instance Method Details
#value ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dead_code_terminator/cond/env_index.rb', line 10 def value return if ast.type != :index hash, key = ast.children return if hash != s(:const, nil, :ENV) return unless (matched_env_key = given_env_key(key)) env[matched_env_key] ? THEN : ELSE end |