Class: Spider::Model::SortTask

Inherits:
Object
  • Object
show all
Defined in:
lib/spiderfw/model/model.rb

Overview

Helper class for sorting models

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ SortTask

Returns a new instance of SortTask.



445
446
447
448
# File 'lib/spiderfw/model/model.rb', line 445

def initialize(model)
    @model = model
    @dependencies = []
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



443
444
445
# File 'lib/spiderfw/model/model.rb', line 443

def dependencies
  @dependencies
end

#modelObject (readonly)

Returns the value of attribute model.



443
444
445
# File 'lib/spiderfw/model/model.rb', line 443

def model
  @model
end

Instance Method Details

#<<(model) ⇒ Object



450
451
452
# File 'lib/spiderfw/model/model.rb', line 450

def <<(model)
    @dependencies << model
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


454
455
456
# File 'lib/spiderfw/model/model.rb', line 454

def eql?(other)
    @model == other.model
end

#inspectObject



458
459
460
# File 'lib/spiderfw/model/model.rb', line 458

def inspect
    "#{@model.name} -> (#{dependencies.map{|d| d.model.name }.join(', ')})"
end