Class: Stratagem::Crawler::SiteModel::Edge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, type) ⇒ Edge

Returns a new instance of Edge.



6
7
8
9
10
# File 'lib/stratagem/crawler/site_model/edge.rb', line 6

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

Instance Attribute Details

#fromObject

type -> :link, :redirect,



4
5
6
# File 'lib/stratagem/crawler/site_model/edge.rb', line 4

def from
  @from
end

#toObject

type -> :link, :redirect,



4
5
6
# File 'lib/stratagem/crawler/site_model/edge.rb', line 4

def to
  @to
end

#typeObject

type -> :link, :redirect,



4
5
6
# File 'lib/stratagem/crawler/site_model/edge.rb', line 4

def type
  @type
end

Instance Method Details

#exportObject



12
13
14
15
16
17
18
# File 'lib/stratagem/crawler/site_model/edge.rb', line 12

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