Class: Dread::AssociationGraph

Inherits:
Object
  • Object
show all
Defined in:
lib/dread/association_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(clazz_data, pluralized = false, collected_clazzes = []) ⇒ AssociationGraph

Returns a new instance of AssociationGraph.



8
9
10
11
12
# File 'lib/dread/association_graph.rb', line 8

def initialize(clazz_data, pluralized=false, collected_clazzes=[])
  set_and_verify_clazz_and_relation(clazz_data)
  @pluralized = pluralized
  @collected_clazzes = collected_clazzes
end

Instance Attribute Details

#clazzObject (readonly)

Returns the value of attribute clazz.



6
7
8
# File 'lib/dread/association_graph.rb', line 6

def clazz
  @clazz
end

#collected_clazzesObject (readonly)

Returns the value of attribute collected_clazzes.



6
7
8
# File 'lib/dread/association_graph.rb', line 6

def collected_clazzes
  @collected_clazzes
end

#dependable_collectionObject (readonly)

{ user: { tweets: { comments: {} }, comments: {}, setting: {} } }



15
16
17
# File 'lib/dread/association_graph.rb', line 15

def dependable_collection
  @dependable_collection
end

Instance Method Details

#draw(output = 'console_output') ⇒ Object



23
24
25
26
27
28
# File 'lib/dread/association_graph.rb', line 23

def draw(output='console_output')
  case output
  when 'console_output'
    ConsoleOutput.generate(dependable_collection)
  end
end