Class: AutoConsul::Cluster::Registry::S3Provider::S3Member

Inherits:
Object
  • Object
show all
Defined in:
lib/auto-consul/providers/s3.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s3obj) ⇒ S3Member

Returns a new instance of S3Member.



9
10
11
12
13
# File 'lib/auto-consul/providers/s3.rb', line 9

def initialize s3obj
  @s3_object = s3obj
  @time, @identifier = S3Provider.from_key_base(File.basename(s3obj.key))
  @data_read = false
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



7
8
9
# File 'lib/auto-consul/providers/s3.rb', line 7

def identifier
  @identifier
end

#s3_objectObject (readonly)

Returns the value of attribute s3_object.



7
8
9
# File 'lib/auto-consul/providers/s3.rb', line 7

def s3_object
  @s3_object
end

#timeObject (readonly)

Returns the value of attribute time.



7
8
9
# File 'lib/auto-consul/providers/s3.rb', line 7

def time
  @time
end

Instance Method Details

#dataObject



15
16
17
18
19
20
21
# File 'lib/auto-consul/providers/s3.rb', line 15

def data
  if not @data_read
    @data = s3_object.read
    @data_read = true
  end
  @data
end