Sha256: 6de57aa1a6f82afc7d01c7d8f6dcf27f05eebcf1e244362834b120aeda7c1fa3

Contents?: true

Size: 404 Bytes

Versions: 18

Compression:

Stored size: 404 Bytes

Contents

module A9n
  class Scope
    ROOT_NAMES = [:configuration, :a9n].freeze

    attr_reader :name

    def initialize(name)
      @name = name.to_sym
    end

    def root?
      ROOT_NAMES.include?(name)
    end

    def env_key_name(key)
      (root? ? key : "#{name}_#{key}").upcase
    end

    def self.form_file_path(path)
      new(File.basename(path.to_s).split('.').first.to_sym)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
a9n-1.5.1 lib/a9n/scope.rb
a9n-1.5.0 lib/a9n/scope.rb
a9n-1.3.1 lib/a9n/scope.rb
a9n-1.3.0 lib/a9n/scope.rb
a9n-1.2.3 lib/a9n/scope.rb
a9n-1.2.2 lib/a9n/scope.rb
a9n-1.2.1 lib/a9n/scope.rb
a9n-1.2.0 lib/a9n/scope.rb
a9n-1.1.1 lib/a9n/scope.rb
a9n-1.1.0 lib/a9n/scope.rb
a9n-1.0.0 lib/a9n/scope.rb
a9n-0.10.0 lib/a9n/scope.rb
a9n-0.9.1 lib/a9n/scope.rb
a9n-0.9.0 lib/a9n/scope.rb
a9n-0.8.3 lib/a9n/scope.rb
a9n-0.8.2 lib/a9n/scope.rb
a9n-0.8.0 lib/a9n/scope.rb
a9n-0.7.0 lib/a9n/scope.rb