Class: MendixBridge::ChangePlanner::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/mendix_bridge/change_planner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#operationsObject (readonly)

Returns the value of attribute operations

Returns:

  • (Object)

    the current value of operations



11
12
13
# File 'lib/mendix_bridge/change_planner.rb', line 11

def operations
  @operations
end

#preserved_undeclaredObject (readonly)

Returns the value of attribute preserved_undeclared

Returns:

  • (Object)

    the current value of preserved_undeclared



11
12
13
# File 'lib/mendix_bridge/change_planner.rb', line 11

def preserved_undeclared
  @preserved_undeclared
end

Instance Method Details

#blocked?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/mendix_bridge/change_planner.rb', line 18

def blocked?
  operations.any? { |operation| operation.action == "blocked" }
end

#countsObject



12
13
14
15
16
# File 'lib/mendix_bridge/change_planner.rb', line 12

def counts
  operations.each_with_object(Hash.new(0)) do |operation, result|
    result[operation.action] += 1
  end.sort.to_h
end

#to_hObject



22
23
24
25
26
27
28
# File 'lib/mendix_bridge/change_planner.rb', line 22

def to_h
  {
    operations: operations.map(&:to_h),
    counts:,
    preserved_undeclared:
  }
end