Sha256: da8202ac5f50939a2830135b9d796058bcaea48998beb52718ad792c8cc04bec

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

module EnoughFields
  class AttributeValue
    attr_reader :klass, :field, :call_stack
    attr_writer :call_stack, :used

    def initialize(value, klass, field, call_stack)
      @value = value
      @klass = klass
      @field = field.to_sym
      @call_stack = call_stack
      @used = false
    end

    def to_value
      @value
    end

    def used?
      @used == true
    end

    def eql?( other )
      self.klass == other.klass &&
      self.field == other.field &&
      self.call_stack == other.call_stack
    end

    def hash
      self.klass.hash + self.field.hash + self.call_stack.hash
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enough_fields-0.0.3 lib/enough_fields/attribute_value.rb
enough_fields-0.0.2 lib/enough_fields/attribute_value.rb