Class: Jeka::Implementation

Inherits:
Object
  • Object
show all
Defined in:
lib/jeka/implementation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Implementation

Returns a new instance of Implementation.



9
10
11
12
# File 'lib/jeka/implementation.rb', line 9

def initialize(name)
  @name = name
  @information = {}
end

Instance Attribute Details

#compilerObject

Returns the value of attribute compiler.



7
8
9
# File 'lib/jeka/implementation.rb', line 7

def compiler
  @compiler
end

#databaseObject (readonly)

Returns the value of attribute database.



5
6
7
# File 'lib/jeka/implementation.rb', line 5

def database
  @database
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/jeka/implementation.rb', line 6

def name
  @name
end

Instance Method Details

#informationObject



23
24
25
# File 'lib/jeka/implementation.rb', line 23

def information
  @information
end

#information=(info) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/jeka/implementation.rb', line 14

def information=(info)
  if info.kind_of? Hash
    @information = info
  else
    @yaml = YAML::load(File.open(info))
    @yaml.each_key {|key| @information[key.to_sym] = @yaml[key]}
  end
end

#jekafyObject



27
28
29
30
31
32
33
# File 'lib/jeka/implementation.rb', line 27

def jekafy
  @database = Jeka::Analysis::Implementation.create!(
    name: @name,
    compiler: @compiler.jekafy,
    implementation_information: Jeka::Analysis::ImplementationInformation.convert(@information)
  )
end