Class: ActiveRecord::Inequality::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Inequality::Base
show all
- Defined in:
- lib/inequal_opportunity.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(val) ⇒ Base
Returns a new instance of Base.
10
11
12
|
# File 'lib/inequal_opportunity.rb', line 10
def initialize(val)
self.value = val
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
8
9
10
|
# File 'lib/inequal_opportunity.rb', line 8
def value
@value
end
|
Instance Method Details
#==(val) ⇒ Object
18
19
20
|
# File 'lib/inequal_opportunity.rb', line 18
def ==(val)
self.operator == val.operator && self.value == val.value
end
|
#inspect ⇒ Object
26
27
28
|
# File 'lib/inequal_opportunity.rb', line 26
def inspect
" #{operator} #{self.string_value}"
end
|
#operator ⇒ Object
14
15
16
|
# File 'lib/inequal_opportunity.rb', line 14
def operator
raise('Nope')
end
|
#string_value ⇒ Object
22
23
24
|
# File 'lib/inequal_opportunity.rb', line 22
def string_value
value ? "'#{value}'" : 'nil'
end
|