Ravn::Tactical::

Role class

Role data class for the Ravn-Tactical service. These eventually turn into Ravn::BDE::Segment::Group objects when combined with a mission.

Attributes

name RW

The role name

Public Class Methods

new( name )

Create a new role

   # File lib/ravn/tactical/role.rb
23 def initialize( name )
24     @name = name
25 end

Public Instance Methods

==( other_object )

Comparison API – returns true if other_object has the same fields as the receiver.

   # File lib/ravn/tactical/role.rb
53 def ==( other_object )
54     return other_object.is_a?( self.class ) &&
55         other_object.fields == self.fields
56 end
deconstruct_keys( * )

Pattern-matching API – return a Hash that is used when pattern-matching on this Role.

   # File lib/ravn/tactical/role.rb
61 def deconstruct_keys( * )
62     return self.fields
63 end
fields()

Return a Hash of the Role’s values.

   # File lib/ravn/tactical/role.rb
44 def fields
45     return {
46         name: self.name,
47     }
48 end
inspect_details()

Ravn::Inspection API – return the details portion of the object’s debugging string form.

   # File lib/ravn/tactical/role.rb
67 def inspect_details
68     return "%s" % [
69         self.name,
70     ]
71 end
to_segment()

Return a Ravn::BDE::Segment that is equivalent to this Role.

   # File lib/ravn/tactical/role.rb
38 def to_segment
39     return Ravn::BDE::Segment.create( :group, self.name, **self.fields.except(:name) )
40 end