Sha256: a8bdb7cbabb7a7ca278efc41ec027d39c8dc74b38495404a70613b38437ac22b
Contents?: true
Size: 556 Bytes
Versions: 13
Compression:
Stored size: 556 Bytes
Contents
# frozen_string_literal: true # GroupAction is compose of multiple actions. class NodeMutation::GroupAction < NodeMutation::Action DEFAULT_START = 2**30 # Initialize a GroupAction. def initialize @actions = [] @type = :group end def new_code nil end private # Calculate the begin and end positions. def calculate_position @start = DEFAULT_START @end = 0 NodeMutation::Helper.iterate_actions(@actions) do |action| @start = [action.start, @start].min @end = [action.end, @end].max end end end
Version data entries
13 entries across 13 versions & 1 rubygems