Module: Delphix::Base

Includes:
Error
Included in:
Database, Environment, Group, Repository
Defined in:
lib/delphix/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailsObject

Returns the value of attribute details.



5
6
7
# File 'lib/delphix/base.rb', line 5

def details
  @details
end

Instance Method Details

#base_endpointObject



37
38
39
# File 'lib/delphix/base.rb', line 37

def base_endpoint
  # Placeholder. Subclasses need to implement this
end

#initialize(reference = nil, details = nil) ⇒ Object

The private new method accepts a connection and a hash



8
9
10
11
12
13
14
# File 'lib/delphix/base.rb', line 8

def initialize(reference=nil, details=nil)
  if details == nil
    @details = { 'reference' => reference }
  else
    @details = details
  end
end

#nameObject



20
21
22
# File 'lib/delphix/base.rb', line 20

def name
  @details['name'] || ''
end

#referenceObject



24
25
26
# File 'lib/delphix/base.rb', line 24

def reference
  @details['reference'] || ''
end

#refresh_detailsObject



33
34
35
# File 'lib/delphix/base.rb', line 33

def refresh_details
  # Placeholder. Subclasses need to implement this
end

#to_sObject



41
42
43
# File 'lib/delphix/base.rb', line 41

def to_s
  "#{self.class.name}[#{type}, #{name}, #{reference}]"
end

#typeObject



16
17
18
# File 'lib/delphix/base.rb', line 16

def type
  @details['type'] || 'unknown'
end