Module: Opal::SourceMap::Map

Included in:
File, Index
Defined in:
opal/lib/opal/source_map/map.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



15
16
17
# File 'opal/lib/opal/source_map/map.rb', line 15

def as_json(*)
  to_h
end

#cacheObject

Marshaling for cache shortpath



28
29
30
31
# File 'opal/lib/opal/source_map/map.rb', line 28

def cache
  @to_h ||= map
  self
end

#marshal_dumpObject



33
34
35
# File 'opal/lib/opal/source_map/map.rb', line 33

def marshal_dump
  [to_h, generated_code]
end

#marshal_load(value) ⇒ Object



37
38
39
# File 'opal/lib/opal/source_map/map.rb', line 37

def marshal_load(value)
  @to_h, @generated_code = value
end

#to_data_uri_commentObject



23
24
25
# File 'opal/lib/opal/source_map/map.rb', line 23

def to_data_uri_comment
  "//# sourceMappingURL=data:application/json;base64,#{Base64.encode64(to_json).delete("\n")}"
end

#to_hObject



7
8
9
# File 'opal/lib/opal/source_map/map.rb', line 7

def to_h
  @to_h || map
end

#to_jsonObject



11
12
13
# File 'opal/lib/opal/source_map/map.rb', line 11

def to_json
  to_h.to_json
end

#to_sObject



19
20
21
# File 'opal/lib/opal/source_map/map.rb', line 19

def to_s
  to_h.to_s
end