Class: EVSS::IntentToFile::IntentToFile
- Inherits:
-
Common::Base
- Object
- Common::Base
- EVSS::IntentToFile::IntentToFile
- Defined in:
- lib/evss/intent_to_file/intent_to_file.rb
Overview
Model for an intent to file
Constant Summary collapse
- STATUS_TYPES =
The spelling of these status types has been validated with the partner team
%w[ active claim_recieved duplicate expired incomplete canceled ].freeze
Instance Attribute Summary collapse
-
#creation_date ⇒ DateTime
Date and time the intent to file was created.
-
#expiration_date ⇒ DateTime
Date and time the intent to file will expire.
-
#id ⇒ String
Intent to file ID.
-
#participant_id ⇒ Integer
The user’s participant ID.
-
#source ⇒ String
The intent to file source.
-
#status ⇒ String
The intent to file status.
-
#type ⇒ String
The intent to file type.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#expires_within_one_day? ⇒ Boolean
Does the intent to file expire within one day.
-
#initialize(args) ⇒ IntentToFile
constructor
A new instance of IntentToFile.
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(args) ⇒ IntentToFile
Returns a new instance of IntentToFile.
46 47 48 49 50 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 46 def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end |
Instance Attribute Details
#creation_date ⇒ DateTime
Returns Date and time the intent to file was created.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#expiration_date ⇒ DateTime
Returns Date and time the intent to file will expire.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#id ⇒ String
Returns Intent to file ID.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#participant_id ⇒ Integer
Returns The user’s participant ID.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#source ⇒ String
Returns The intent to file source.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#status ⇒ String
Returns The intent to file status.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
#type ⇒ String
Returns The intent to file type.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 27 class IntentToFile < Common::Base # The spelling of these status types has been validated with the partner team STATUS_TYPES = %w[ active claim_recieved duplicate expired incomplete canceled ].freeze attribute :id, String attribute :creation_date, DateTime attribute :expiration_date, DateTime attribute :participant_id, Integer attribute :source, String attribute :status, String attribute :type, String def initialize(args) raise ArgumentError, "invalid status type: #{args['status']}" unless STATUS_TYPES.include? args['status'] super(args) end ## # @return [Boolean] Does the intent to file expire within one day # def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end end |
Instance Method Details
#expires_within_one_day? ⇒ Boolean
Returns Does the intent to file expire within one day.
55 56 57 58 59 |
# File 'lib/evss/intent_to_file/intent_to_file.rb', line 55 def expires_within_one_day? current = Time.current one_day_from_current = current + 1.day (current..one_day_from_current).cover? expiration_date end |