Sha256: 89049f1adac8ded59c5f5e7ac5d5dc8f754e1a8c2973d3690d8d3c28cabfd47a

Contents?: true

Size: 355 Bytes

Versions: 33

Compression:

Stored size: 355 Bytes

Contents

module Expressive
  
  class ExtendedValue
    attr_accessor :setter, :adder
    def initialize(property_name, scope)
      @scope = scope
      @property_name = property_name.to_s

      @scope[@property_name] = self
    end

    def set(value)
      setter.call value, @scope
    end

    def <<(value)
      adder.call value, @scope
    end
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
expressive-0.0.42 lib/extended_value.rb
expressive-0.0.41 lib/extended_value.rb
expressive-0.0.40 lib/extended_value.rb
expressive-0.0.39 lib/extended_value.rb
expressive-0.0.38 lib/extended_value.rb
expressive-0.0.37 lib/extended_value.rb
expressive-0.0.36 lib/extended_value.rb
expressive-0.0.35 lib/extended_value.rb
expressive-0.0.34 lib/extended_value.rb
expressive-0.0.33 lib/extended_value.rb
expressive-0.0.32 lib/extended_value.rb
expressive-0.0.31 lib/extended_value.rb
expressive-0.0.30 lib/extended_value.rb
expressive-0.0.29 lib/extended_value.rb
expressive-0.0.28 lib/extended_value.rb
expressive-0.0.27 lib/extended_value.rb
expressive-0.0.26 lib/extended_value.rb
expressive-0.0.25 lib/extended_value.rb
expressive-0.0.24 lib/extended_value.rb
expressive-0.0.23 lib/extended_value.rb