Class: World
- Inherits:
-
Object
- Object
- World
- Defined in:
- lib/asker/data/world.rb
Instance Attribute Summary collapse
-
#concepts ⇒ Object
readonly
TODO: change how World class works ?.
-
#contexts ⇒ Object
readonly
TODO: change how World class works ?.
-
#filenames ⇒ Object
readonly
TODO: change how World class works ?.
-
#image_urls ⇒ Object
readonly
TODO: change how World class works ?.
Instance Method Summary collapse
-
#find_neighbors_for_every_concept(concepts) ⇒ Object
For every concept…
-
#initialize(concepts, internet = true) ⇒ World
constructor
A new instance of World.
Constructor Details
#initialize(concepts, internet = true) ⇒ World
Returns a new instance of World.
9 10 11 12 13 |
# File 'lib/asker/data/world.rb', line 9 def initialize(concepts, internet = true) find_neighbors_for_every_concept(concepts) @concepts, @filenames, @contexts = get_lists_from(concepts) @image_urls = find_url_images_from_internet(internet) end |
Instance Attribute Details
#concepts ⇒ Object (readonly)
TODO: change how World class works ?
7 8 9 |
# File 'lib/asker/data/world.rb', line 7 def concepts @concepts end |
#contexts ⇒ Object (readonly)
TODO: change how World class works ?
7 8 9 |
# File 'lib/asker/data/world.rb', line 7 def contexts @contexts end |
#filenames ⇒ Object (readonly)
TODO: change how World class works ?
7 8 9 |
# File 'lib/asker/data/world.rb', line 7 def filenames @filenames end |
#image_urls ⇒ Object (readonly)
TODO: change how World class works ?
7 8 9 |
# File 'lib/asker/data/world.rb', line 7 def image_urls @image_urls end |
Instance Method Details
#find_neighbors_for_every_concept(concepts) ⇒ Object
For every concept… find its neighbors
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/asker/data/world.rb', line 18 def find_neighbors_for_every_concept(concepts) concepts.each do |i| concepts.each do |j| if i.id != j.id i.try_adding_neighbor(j) i.try_adding_references(j) end end end end |