Class: EnoughFields::AttributeValue
- Inherits:
-
Object
- Object
- EnoughFields::AttributeValue
- Defined in:
- lib/enough_fields/attribute_value.rb
Instance Attribute Summary collapse
-
#call_stack ⇒ Object
Returns the value of attribute call_stack.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#used ⇒ Object
writeonly
Sets the attribute used.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(value, klass, field, call_stack) ⇒ AttributeValue
constructor
A new instance of AttributeValue.
- #to_value ⇒ Object
- #used? ⇒ Boolean
Constructor Details
#initialize(value, klass, field, call_stack) ⇒ AttributeValue
Returns a new instance of AttributeValue.
6 7 8 9 10 11 12 |
# File 'lib/enough_fields/attribute_value.rb', line 6 def initialize(value, klass, field, call_stack) @value = value @klass = klass @field = field.to_sym @call_stack = call_stack @used = false end |
Instance Attribute Details
#call_stack ⇒ Object
Returns the value of attribute call_stack.
3 4 5 |
# File 'lib/enough_fields/attribute_value.rb', line 3 def call_stack @call_stack end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
3 4 5 |
# File 'lib/enough_fields/attribute_value.rb', line 3 def field @field end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/enough_fields/attribute_value.rb', line 3 def klass @klass end |
#used=(value) ⇒ Object (writeonly)
Sets the attribute used
4 5 6 |
# File 'lib/enough_fields/attribute_value.rb', line 4 def used=(value) @used = value end |
Instance Method Details
#eql?(other) ⇒ Boolean
22 23 24 25 26 |
# File 'lib/enough_fields/attribute_value.rb', line 22 def eql?( other ) self.klass == other.klass && self.field == other.field && self.call_stack == other.call_stack end |
#hash ⇒ Object
28 29 30 |
# File 'lib/enough_fields/attribute_value.rb', line 28 def hash self.klass.hash + self.field.hash + self.call_stack.hash end |
#to_value ⇒ Object
14 15 16 |
# File 'lib/enough_fields/attribute_value.rb', line 14 def to_value @value end |
#used? ⇒ Boolean
18 19 20 |
# File 'lib/enough_fields/attribute_value.rb', line 18 def used? @used == true end |