Sha256: 33df9b5a3bd6d612ff16581c3f8ce315f041470b0c8e5b92909d4c7a4e2eae34

Contents?: true

Size: 367 Bytes

Versions: 2

Compression:

Stored size: 367 Bytes

Contents

class CaptainConfig::ConfiguredEntry
  attr_reader :key
  # Class of the model (eg. `CaptainConfig::BooleanConfig`).
  attr_reader :model
  attr_accessor :default

  def initialize(key, model)
    @key = key
    @model = model
    @default = nil
  end

  def default_value
    if default.respond_to?(:call)
      default.call
    else
      default
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
captain_config-1.1.0 lib/captain_config/configured_entry.rb
captain_config-1.0.0 lib/captain_config/configured_entry.rb