Class: Bsm::Constrainable::Operation::Base
- Inherits:
-
Object
- Object
- Bsm::Constrainable::Operation::Base
show all
- 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.
9
10
11
12
13
|
# File 'lib/bsm/constrainable/operation/base.rb', line 9
def initialize(value, relation, field)
@value = value
@relation = relation
@field = field
end
|
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
7
8
9
|
# File 'lib/bsm/constrainable/operation/base.rb', line 7
def field
@field
end
|
#relation ⇒ Object
Returns the value of attribute relation.
7
8
9
|
# File 'lib/bsm/constrainable/operation/base.rb', line 7
def relation
@relation
end
|
#value ⇒ Object
Returns the value of attribute value.
7
8
9
|
# File 'lib/bsm/constrainable/operation/base.rb', line 7
def value
@value
end
|
Class Method Details
.kind ⇒ Object
3
4
5
|
# File 'lib/bsm/constrainable/operation/base.rb', line 3
def self.kind
name.demodulize.underscore.to_sym
end
|
Instance Method Details
#clause ⇒ Object
28
29
30
31
|
# File 'lib/bsm/constrainable/operation/base.rb', line 28
def clause
return @clause if defined?(@clause)
@clause ||= valid? ? _clause : nil
end
|
#invalid? ⇒ Boolean
23
24
25
26
|
# File 'lib/bsm/constrainable/operation/base.rb', line 23
def invalid?
wrap = Array.wrap(normalized)
wrap.empty? || wrap.any?(&:nil?)
end
|
#parsed ⇒ Object
15
16
17
|
# File 'lib/bsm/constrainable/operation/base.rb', line 15
def parsed
value.to_s
end
|
#valid? ⇒ Boolean
19
20
21
|
# File 'lib/bsm/constrainable/operation/base.rb', line 19
def valid?
!invalid?
end
|