Class: Bsm::Constrainable::Operation::Base
- Inherits:
-
Object
- Object
- Bsm::Constrainable::Operation::Base
show all
- Extended by:
- ActiveSupport::Memoizable
- Defined in:
- lib/bsm/constrainable/operation/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(value, relation, field) ⇒ Base
Returns a new instance of Base.
10
11
12
13
14
|
# File 'lib/bsm/constrainable/operation/base.rb', line 10
def initialize(value, relation, field)
@value = value
@relation = relation
@field = field
end
|
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
8
9
10
|
# File 'lib/bsm/constrainable/operation/base.rb', line 8
def field
@field
end
|
#relation ⇒ Object
Returns the value of attribute relation.
8
9
10
|
# File 'lib/bsm/constrainable/operation/base.rb', line 8
def relation
@relation
end
|
#value ⇒ Object
Returns the value of attribute value.
8
9
10
|
# File 'lib/bsm/constrainable/operation/base.rb', line 8
def value
@value
end
|
Class Method Details
.kind ⇒ Object
4
5
6
|
# File 'lib/bsm/constrainable/operation/base.rb', line 4
def self.kind
name.demodulize.underscore.to_sym
end
|
Instance Method Details
#clause ⇒ Object
29
30
31
|
# File 'lib/bsm/constrainable/operation/base.rb', line 29
def clause
valid? ? _clause : nil
end
|
#invalid? ⇒ Boolean
24
25
26
27
|
# File 'lib/bsm/constrainable/operation/base.rb', line 24
def invalid?
wrap = Array.wrap(normalized)
wrap.empty? || wrap.any?(&:nil?)
end
|
#parsed ⇒ Object
16
17
18
|
# File 'lib/bsm/constrainable/operation/base.rb', line 16
def parsed
value.to_s
end
|
#valid? ⇒ Boolean
20
21
22
|
# File 'lib/bsm/constrainable/operation/base.rb', line 20
def valid?
!invalid?
end
|