class Terrestrial::Cli::Bootstrapper::Entry::Occurence

Public Class Methods

from_hash(hash, index) click to toggle source
# File lib/terrestrial/cli/bootstrapper.rb, line 135
def self.from_hash(hash, index)
  new.tap do |occurence|
    occurence.file         = hash.fetch("file")
    occurence.line_number  = hash.fetch("line_number") { nil }
    occurence.type         = hash.fetch("type") { "unknown" }
    occurence.language     = hash.fetch("language")
    occurence.metadata     = hash.fetch("metadata") { Hash.new }
    occurence.result_index = index
  end
end