Class: Docks::Languages::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/docks/languages/json_language.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#parser, #renderer, symbol_sources

Constructor Details

#initializeJSON

Returns a new instance of JSON.



9
10
11
# File 'lib/docks/languages/json_language.rb', line 9

def initialize
  require "json"
end

Class Method Details

.extensionsObject



7
# File 'lib/docks/languages/json_language.rb', line 7

def self.extensions; %w(json) end

.typeObject



6
# File 'lib/docks/languages/json_language.rb', line 6

def self.type; Docks::Types::Languages::STUB end

Instance Method Details

#load_stub(file) ⇒ Object



13
14
15
# File 'lib/docks/languages/json_language.rb', line 13

def load_stub(file)
  ::JSON::load(File.read(file).force_encoding("UTF-8"))
end