Module: Parliament::Grom::Decorator::AnsweringBody

Defined in:
lib/parliament/grom/decorator/answering_body.rb

Overview

Decorator namespace for Grom::Node instances with type: id.parliament.uk/schema/AnsweringBody.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#answersGrom::Node, []

Alias answeringBodyHasAnswer with fallback.

Returns:

  • (Grom::Node, [])

    the answer of the Grom::Node or nil.

Since:

  • 0.1.0



16
17
18
# File 'lib/parliament/grom/decorator/answering_body.rb', line 16

def answers
  respond_to?(:answeringBodyHasAnswer) ? answeringBodyHasAnswer : []
end

#nameString

Alias groupName with fallback.

Returns:

  • (String, String)

    the name of the Grom::Node or an empty string.

Since:

  • 0.1.0



9
10
11
# File 'lib/parliament/grom/decorator/answering_body.rb', line 9

def name
  respond_to?(:groupName) ? groupName : ''
end