Module: Parliament::Grom::Decorator::Laying

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

Overview

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

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#bodyGrom::Node?

Alias layingHasLayingBody with fallback.

Returns:

  • (Grom::Node, nil)

    the LayingBody of the Grom::Node or nil.

Since:

  • 0.1.0



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

def body
  respond_to?(:layingHasLayingBody) ? layingHasLayingBody.first : nil
end

#dateDate?

Alias layingDate with fallback.

Returns:

  • (Date, nil)

    the date of the Grom::Node or nil.

Since:

  • 0.1.0



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

def date
  respond_to?(:layingDate) ? DateTime.parse(layingDate) : nil
end

#personGrom::Node?

Alias layingHasLayingPerson with fallback.

Returns:

  • (Grom::Node, nil)

    the LayingPerson of the Grom::Node or nil.

Since:

  • 0.1.0



23
24
25
# File 'lib/parliament/grom/decorator/laying.rb', line 23

def person
  respond_to?(:layingHasLayingPerson) ? layingHasLayingPerson.first : nil
end