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.



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

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

Instance Attribute Details

#fromObject

type -> :link, :redirect,



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

def from
  @from
end

#toObject

type -> :link, :redirect,



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

def to
  @to
end

#typeObject

type -> :link, :redirect,



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

def type
  @type
end

Instance Method Details

#exportObject



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

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