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
19
20
21
# File 'lib/parliament/grom/decorator/laying.rb', line 16

def body
  return @body if @body
  return nil unless respond_to?(:layingHasLayingBody)

  @body = Helpers::Utils.type_safe_first(layingHasLayingBody, Parliament::Grom::Decorator::Group)
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

#laid_thingGrom::Node?

Alias layingHasLaidThing with fallback.

Returns:

  • (Grom::Node, nil)

    the LaidThing of the Grom::Node or nil.

Since:

  • 0.1.0



46
47
48
49
50
51
# File 'lib/parliament/grom/decorator/laying.rb', line 46

def laid_thing
  return @laid_thing if @laid_thing
  return nil unless respond_to?(:layingHasLaidThing)

  @laid_thing = Helpers::Utils.type_safe_first(layingHasLaidThing, Parliament::Grom::Decorator::LaidThing)
end

#personGrom::Node?

Alias layingHasLayingPerson with fallback.

Returns:

  • (Grom::Node, nil)

    the LayingPerson of the Grom::Node or nil.

Since:

  • 0.1.0



36
37
38
39
40
41
# File 'lib/parliament/grom/decorator/laying.rb', line 36

def person
  return @person if @person
  return nil unless respond_to?(:layingHasLayingPerson)

  @person = Helpers::Utils.type_safe_first(layingHasLayingPerson, Parliament::Grom::Decorator::Person)
end

#procedure_stepGrom::Node?

Alias businessItemHasProcedureStep with fallback.

Returns:

  • (Grom::Node, nil)

    the ProcedureStep of the Grom::Node or nil.

Since:

  • 0.1.0



26
27
28
29
30
31
# File 'lib/parliament/grom/decorator/laying.rb', line 26

def procedure_step
  return @procedure_step if @procedure_step
  return nil unless respond_to?(:businessItemHasProcedureStep)

  @procedure_step = Helpers::Utils.type_safe_first(businessItemHasProcedureStep, Parliament::Grom::Decorator::ProcedureStep)
end