Class: Stratagem::Crawler::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/stratagem/crawler/site_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, type) ⇒ Edge

Returns a new instance of Edge.



52
53
54
55
56
# File 'lib/stratagem/crawler/site_model.rb', line 52

def initialize(from, to, type)
  @from = from
  @to = to
  @type = type
end

Instance Attribute Details

#fromObject

type -> :link, :redirect,



50
51
52
# File 'lib/stratagem/crawler/site_model.rb', line 50

def from
  @from
end

#toObject

type -> :link, :redirect,



50
51
52
# File 'lib/stratagem/crawler/site_model.rb', line 50

def to
  @to
end

#typeObject

type -> :link, :redirect,



50
51
52
# File 'lib/stratagem/crawler/site_model.rb', line 50

def type
  @type
end

Instance Method Details

#exportObject



58
59
60
61
62
63
64
# File 'lib/stratagem/crawler/site_model.rb', line 58

def export
  {
    :from => from.object_id,
    :to => to.object_id,
    :relation_type => type
  }
end