Method: Api::RequestQueryPathing#as_json

Defined in:
lib/sc2ai/protocol/query_pb.rb

#as_json(options = {}) ⇒ Object



2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
# File 'lib/sc2ai/protocol/query_pb.rb', line 2662

def as_json(options = {})
  result = {}

  resolved_start = self.start

  result["startPos"] = (
    if @start_pos.nil?
      {}
    else
      @start_pos.as_json(options)
    end
  ) if resolved_start == :"start_pos"
  result["unitTag"] = @unit_tag if resolved_start == :"unit_tag"
  result["endPos"] = (
    if @end_pos.nil?
      {}
    else
      @end_pos.as_json(options)
    end
  ) if !options[:compact] || has_end_pos?

  result
end