Append to group

I’m new here.
Lets say I get all selected edges like so:

def self.selected_edges
	ss = Sketchup.active_model.selection
	edgelist = []
	ss.each do |entity|
		edgelist.push(entity) if entity.is_a? Sketchup::Edge
	end
	edgelist
end

how do I make a group with them?
the following does NOT work:

group = entities.add_group
group.entities.add_edges(selected_edges)

You can only make a group directly from entities that are in the same context as the group itself.
You haven’t explained what ‘entities’ is…
Here is an example of making a group of all selected edges, if they also support faces they are cloned into the group.
It then modifies that group - here I show some text…

def self.select_edges()
  @model = Sketchup.active_model
  return @model.selection.grep(Sketchup::Edge)
end
def self.make_group()
  @model = Sketchup.active_model
  edges = self.select_edges()
  if edges[0]
    @group = @model.active_entities.add_group(edges)
    @group.name = "Selected_Edges"
  else
    @group = nil
  end
  return @group
end
def self.add_text_to_group(group)
  return nil unless group
  group.entities.add_text("Selected_Edges", ORIGIN, [11,11,11])
end

self.make_group() ### creates the "Selected_Edges" group in the same context as the selected edges...
self.add_text_to_group(@group) ### adds "Selected_Edges" Text into that new group.