Sha256: 534b6dabb13af8797e4fd96dab3e23411c22b02cb4572f37d9d08002f1a4ac71

Contents?: true

Size: 398 Bytes

Versions: 11

Compression:

Stored size: 398 Bytes

Contents

class ServiceSkeleton
  class ConfigVariable
    attr_reader :name

    def initialize(name, **opts, &blk)
      @name = name
      @opts = opts
      @blk  = blk
    end

    def method_name(svc_name)
      name.to_s.gsub(/\A#{Regexp.quote(svc_name)}_/i, '').downcase
    end

    def sensitive?
      !!@opts[:sensitive]
    end

    def value(raw_val)
      @blk.call(raw_val)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
service_skeleton-0.0.0.25.gbf57918 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.20.gb9a0460 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.16.g99ff4d7 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.15.g53952e3 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.14.g60b4507 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.13.ga523c90 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.11.gc1cf3ce lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.3.g1269800.1.gaaa2fa1.6.gf4e308e lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.3.g1269800.1.gaaa2fa1 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.3.g1269800 lib/service_skeleton/config_variable.rb
service_skeleton-0.0.0.2.g46c1e0e lib/service_skeleton/config_variable.rb