Sha256: f524a87319ace2a1217bac1f177a337768879324281e89105ecc08b0630893d6

Contents?: true

Size: 262 Bytes

Versions: 4

Compression:

Stored size: 262 Bytes

Contents

# TODO: allow default: -> for hashes, etc.
module Disposable::Twin::Default
  def setup_value_for(dfn, options)
    value = super
    return value unless value.nil?
    default_for(dfn, options)
  end

  def default_for(dfn, options)
    dfn[:default]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
disposable-0.1.9 lib/disposable/twin/default.rb
disposable-0.1.8 lib/disposable/twin/default.rb
disposable-0.1.7 lib/disposable/twin/default.rb
disposable-0.1.6 lib/disposable/twin/default.rb