module StateHelper
StateHelper
. @module_description
State predicates.
Public Instance Methods
back_attached()
click to toggle source
back_attached
(). @description
A back attribute predicate.
@return [TrueClass, FalseClass]
True in the case back refers a Node instance. False otherwise.
# File lib/helpers/state_helper.rb, line 14 def back_attached() return !back().nil?() end
both_attached()
click to toggle source
both_attached
(). @description
Predicate. Verifies 'back' and 'front' are attachments.
@return [TrueClass, FalseClass]
True in the case 'back' and 'front' refer Nodes. False otherwise.
# File lib/helpers/state_helper.rb, line 50 def both_attached() return (back_attached() && front_attached()) end
empty()
click to toggle source
empty(). @description
A data attribute predicate.
@return [TrueClass, FalseClass]
True in the case data refers nil. False otherwise.
# File lib/helpers/state_helper.rb, line 41 def empty() return data().nil?() end
front_attached()
click to toggle source
front_attached
(). @description
A front attribute predicate.
@return [TrueClass, FalseClass]
True in the case front refers a Node instance. False otherwise.
# File lib/helpers/state_helper.rb, line 23 def front_attached() return !front().nil?() end
no_attachments()
click to toggle source
no_attachments
(). @description
A back and front attribute predicate.
@return [TrueClass, FalseClass]
True in the case back and front refer nil. False otherwise.
# File lib/helpers/state_helper.rb, line 32 def no_attachments() return(!back_attached() && !front_attached()) end