Class: BlobViewer::RouteMap

Inherits:
Base
  • Object
show all
Includes:
Auxiliary, ServerSide
Defined in:
app/models/blob_viewer/route_map.rb

Constant Summary

Constants inherited from Base

Base::PARTIAL_PATH_PREFIX

Instance Attribute Summary

Attributes inherited from Base

#blob

Instance Method Summary collapse

Methods included from Auxiliary

#visible_to?

Methods included from Gitlab::Allowable

#can?

Methods included from ServerSide

#prepare!, #render_error

Methods inherited from Base

auxiliary?, binary?, #binary_detected_after_load?, can_render?, #collapsed?, #initialize, load_async?, loading_partial_path, partial_path, #prepare!, #render_error, rich?, simple?, text?, #too_large?

Constructor Details

This class inherits a constructor from BlobViewer::Base

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'app/models/blob_viewer/route_map.rb', line 28

def valid?
  validation_message.blank?
end

#validation_messageObject


13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/blob_viewer/route_map.rb', line 13

def validation_message
  return @validation_message if defined?(@validation_message)

  prepare!

  @validation_message =
    begin
      Gitlab::RouteMap.new(blob.data)

      nil
    rescue Gitlab::RouteMap::FormatError => e
      e.message
    end
end