Class: MetadataPresenter::DateField
- Inherits:
-
Object
- Object
- MetadataPresenter::DateField
- Defined in:
- app/models/metadata_presenter/date_field.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #blank? ⇒ Boolean
-
#initialize(day:, month:, year:) ⇒ DateField
constructor
A new instance of DateField.
- #present? ⇒ Boolean
Constructor Details
#initialize(day:, month:, year:) ⇒ DateField
Returns a new instance of DateField.
5 6 7 8 9 |
# File 'app/models/metadata_presenter/date_field.rb', line 5 def initialize(day:, month:, year:) @day = day @month = month @year = year end |
Instance Attribute Details
#day ⇒ Object (readonly)
Returns the value of attribute day.
3 4 5 |
# File 'app/models/metadata_presenter/date_field.rb', line 3 def day @day end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
3 4 5 |
# File 'app/models/metadata_presenter/date_field.rb', line 3 def month @month end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
3 4 5 |
# File 'app/models/metadata_presenter/date_field.rb', line 3 def year @year end |
Instance Method Details
#blank? ⇒ Boolean
17 18 19 |
# File 'app/models/metadata_presenter/date_field.rb', line 17 def blank? @day.blank? || @month.blank? || @year.blank? end |
#present? ⇒ Boolean
11 12 13 14 15 |
# File 'app/models/metadata_presenter/date_field.rb', line 11 def present? # rubocop:disable Rails/Present !blank? # rubocop:enable Rails/Present end |