Class: Eg::AllPairs::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/eg/all_pairs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(v, i, n) ⇒ Item

Returns a new instance of Item.



141
142
143
# File 'lib/eg/all_pairs.rb', line 141

def initialize v, i, n
  @var, @index, @rank = v, i, n
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



140
141
142
# File 'lib/eg/all_pairs.rb', line 140

def index
  @index
end

#rankObject

Returns the value of attribute rank.



140
141
142
# File 'lib/eg/all_pairs.rb', line 140

def rank
  @rank
end

#varObject

Returns the value of attribute var.



139
140
141
# File 'lib/eg/all_pairs.rb', line 139

def var
  @var
end

Instance Method Details

#fileObject



144
# File 'lib/eg/all_pairs.rb', line 144

def file; var.files[@index]; end

#is_fit?(slug) ⇒ Boolean

Returns:

  • (Boolean)


145
146
147
# File 'lib/eg/all_pairs.rb', line 145

def is_fit? slug
  slug[var.index].nil? or slug[var.index] == self
end