Class: Nearline::Models::FileSequencer

Inherits:
Object
  • Object
show all
Defined in:
lib/nearline/file_content.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_content) ⇒ FileSequencer

Returns a new instance of FileSequencer.



68
69
70
71
# File 'lib/nearline/file_content.rb', line 68

def initialize(file_content)
  @inc = 0
  @file_content = file_content
end

Instance Method Details

#preserve_content(content) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/nearline/file_content.rb', line 73

def preserve_content(content)
  @inc += 1
  block = Block.for_content(content)
  sequence = Sequence.new(
    :sequence => @inc,
    :file_content_id => @file_content.id,
    :block_id => block.id
  )
  sequence.save!
  sequence        
end