Class: Bitferry::Endpoint::Local

Inherits:
Bitferry::Endpoint show all
Defined in:
lib/bitferry.rb

Constant Summary

Constants inherited from Bitferry::Endpoint

ROUTE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Bitferry::Endpoint

restore

Constructor Details

#initialize(root) ⇒ Local

Returns a new instance of Local.



1325
# File 'lib/bitferry.rb', line 1325

def initialize(root) = @root = Pathname.new(root).realdirpath

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



1322
1323
1324
# File 'lib/bitferry.rb', line 1322

def root
  @root
end

Instance Method Details

#externalizeObject



1331
1332
1333
1334
1335
1336
# File 'lib/bitferry.rb', line 1331

def externalize
  {
    endpoint: :local,
    root: root
  }
end

#generationObject



1348
# File 'lib/bitferry.rb', line 1348

def generation = 0

#intact?Boolean

Returns:

  • (Boolean)


1342
# File 'lib/bitferry.rb', line 1342

def intact? = true

#refers?(volume) ⇒ Boolean

Returns:

  • (Boolean)


1345
# File 'lib/bitferry.rb', line 1345

def refers?(volume) = false

#restore(hash) ⇒ Object



1328
# File 'lib/bitferry.rb', line 1328

def restore(hash) = initialize(hash.fetch(:root))

#show_statusObject



1339
# File 'lib/bitferry.rb', line 1339

def show_status = root.to_s