Module: Workspace::WorkspaceFile::Parse

Extended by:
ActiveSupport::Concern
Included in:
Workspace::WorkspaceFile
Defined in:
lib/workspace/workspace_file/parse.rb

Instance Method Summary collapse

Instance Method Details

#read_haml(options) ⇒ Object



14
15
16
17
18
# File 'lib/workspace/workspace_file/parse.rb', line 14

def read_haml(options)
  require "haml"
  engine = Haml::Engine.new(read)
  engine.render(Object.new, options)
end

#read_jsonObject



6
7
8
# File 'lib/workspace/workspace_file/parse.rb', line 6

def read_json
  JSON.parse(read)
end

#read_yamlObject



10
11
12
# File 'lib/workspace/workspace_file/parse.rb', line 10

def read_yaml
  Psych.load_file(to_s)
end