Module: Parliament::Grom::Decorator::Answer
- Includes:
- Helpers::DateHelper
- Defined in:
- lib/parliament/grom/decorator/answer.rb
Overview
Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/Answer.
Instance Method Summary collapse
-
#answer_given_date ⇒ DateTime?
Alias answerGivenDate with fallback.
-
#answering_person ⇒ Grom::Node?
Alias answerHasAnsweringPerson with fallback.
-
#question ⇒ Grom::Node?
Alias answerHasQuestion with fallback.
-
#text ⇒ String
Alias answerText with fallback.
Methods included from Helpers::DateHelper
Instance Method Details
#answer_given_date ⇒ DateTime?
Alias answerGivenDate with fallback.
17 18 19 |
# File 'lib/parliament/grom/decorator/answer.rb', line 17 def answer_given_date @answer_given_date ||= respond_to?(:answerGivenDate) ? DateTime.parse(answerGivenDate) : nil end |
#answering_person ⇒ Grom::Node?
Alias answerHasAnsweringPerson with fallback.
24 25 26 |
# File 'lib/parliament/grom/decorator/answer.rb', line 24 def answering_person respond_to?(:answerHasAnsweringPerson) ? answerHasAnsweringPerson.first : nil end |
#question ⇒ Grom::Node?
Alias answerHasQuestion with fallback.
31 32 33 |
# File 'lib/parliament/grom/decorator/answer.rb', line 31 def question respond_to?(:answerHasQuestion) ? answerHasQuestion.first : nil end |
#text ⇒ String
Alias answerText with fallback.
10 11 12 |
# File 'lib/parliament/grom/decorator/answer.rb', line 10 def text respond_to?(:answerText) ? answerText : '' end |