Class: Ncn::Draft

Inherits:
Object
  • Object
show all
Defined in:
lib/ncn/draft.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ids:, repository:) ⇒ Draft

Returns a new instance of Draft.



5
6
7
8
# File 'lib/ncn/draft.rb', line 5

def initialize(ids:, repository:)
  @ids = ids
  @repository = repository
end

Instance Attribute Details

#idsObject (readonly)

Returns the value of attribute ids.



3
4
5
# File 'lib/ncn/draft.rb', line 3

def ids
  @ids
end

#repositoryObject (readonly)

Returns the value of attribute repository.



3
4
5
# File 'lib/ncn/draft.rb', line 3

def repository
  @repository
end

Instance Method Details

#open_with {|file_name| ... } ⇒ Object

Yields:

  • (file_name)


10
11
12
13
14
15
# File 'lib/ncn/draft.rb', line 10

def open_with
  dump
  yield file_name
  load
  FileUtils.rm_rf(file_name)
end