Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
biow0lf committed Sep 14, 2016
1 parent 4b9134b commit 65a944e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/eve_online.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@

require 'eve_online/sde/type_ids'
require 'eve_online/sde/type_id'
require 'eve_online/sde/blueprints'
require 'eve_online/sde/blueprint'

module EveOnline
end
26 changes: 26 additions & 0 deletions lib/eve_online/sde/blueprint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module EveOnline
module SDE
class Blueprint
attr_reader :options

def initialize(options)
@options = options
end

def as_json
{
type_id: type_id,
data: data
}
end

def type_id
@type_id ||= options.first
end

def data
@data ||= options.last
end
end
end
end
25 changes: 25 additions & 0 deletions lib/eve_online/sde/blueprints.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module EveOnline
module SDE
class Blueprints
attr_reader :file

def initialize(file)
@file = file
end

def blueprints
@type_ids ||= begin
output = []
content.each do |entry|
output << Blueprint.new(entry)
end
output
end
end

def content
@content ||= YAML.load(File.open(file))
end
end
end
end

0 comments on commit 65a944e

Please sign in to comment.