attribute.rb 592 B

123456789101112131415161718192021222324252627282930
  1. class Sequencer
  2. class Units < SimpleDelegator
  3. class Attribute
  4. attr_accessor :from, :to
  5. # Checks if the attribute will be provided by one or more Units.
  6. #
  7. # @example
  8. # attribute.will_be_provided?
  9. # # => true
  10. #
  11. # @return [Boolean]
  12. def will_be_provided?
  13. !from.nil?
  14. end
  15. # Checks if the attribute will be used by one or more Units.
  16. #
  17. # @example
  18. # attribute.will_be_used?
  19. # # => true
  20. #
  21. # @return [Boolean]
  22. def will_be_used?
  23. !to.nil?
  24. end
  25. end
  26. end
  27. end