Class: ODDB::Remote::Package

Inherits:
Object show all
Defined in:
src/remote/package.rb

Instance Method Summary (collapse)

Methods inherited from Object

#initialize

Constructor Details

This class inherits a constructor from ODDB::Remote::Object

Instance Method Details

- (Boolean) comparable?(other)

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'src/remote/package.rb', line 10

def comparable?(other)
  csize = comparable_size
  csize.length == 1 or return false
  size = csize.first
  range = (size*0.75)..(size*1.25)
  range.include?(other.comparable_size)
end

- (Object) comparable_size



17
18
19
# File 'src/remote/package.rb', line 17

def comparable_size
  @comparable_size ||= @remote.comparable_size
end

- (Object) sequence



20
21
22
# File 'src/remote/package.rb', line 20

def sequence
  @sequence ||= Remote::Sequence.new(@remote.sequence)
end

- (Object) size



23
24
25
# File 'src/remote/package.rb', line 23

def size
  @size ||= @remote.size
end