Module: Parliament::Grom::Decorator::Position

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

Overview

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

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#incumbenciesArray

Alias positionHasIncumbency with fallback.

Returns:

  • (Array, Array)

    all the incumbencies of the Grom::Node or an empty array.

Since:

  • 0.1.0



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

def incumbencies
  respond_to?(:positionHasIncumbency) ? positionHasIncumbency : []
end

#nameString

Alias positionName 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/position.rb', line 9

def name
  respond_to?(:positionName) ? positionName : 'Chair'
end