Class: OpenShift::ComponentRef

Inherits:
Model
  • Object
show all
Defined in:
lib/openshift-origin-common/models/component_ref.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

attr_accessor, attr_reader, attr_writer, #attributes, #attributes=, #deleted?, exclude_attributes, excludes_attributes, gen_uuid, include_attributes, includes_attributes, #new_record?, #persisted?, primary_key, require_update_attributes, requires_update_attributes, #reset_state, #to_xml

Constructor Details

#initialize(name = nil) ⇒ ComponentRef

Returns a new instance of ComponentRef.



5
6
7
# File 'lib/openshift-origin-common/models/component_ref.rb', line 5

def initialize(name=nil)
  self.name = name
end

Instance Attribute Details

#componentObject

Returns the value of attribute component.



3
4
5
# File 'lib/openshift-origin-common/models/component_ref.rb', line 3

def component
  @component
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/openshift-origin-common/models/component_ref.rb', line 3

def name
  @name
end

Instance Method Details

#from_descriptor(spec_hash) ⇒ Object



9
10
11
12
# File 'lib/openshift-origin-common/models/component_ref.rb', line 9

def from_descriptor(spec_hash)
  self.component = spec_hash
  self
end

#get_name_prefix(profile) ⇒ Object



18
19
20
21
22
# File 'lib/openshift-origin-common/models/component_ref.rb', line 18

def get_name_prefix(profile)
  comp_obj = profile.components(self.component)
  return "" if comp_obj.generated
  return "/comp-" + self.name 
end

#to_descriptorObject



14
15
16
# File 'lib/openshift-origin-common/models/component_ref.rb', line 14

def to_descriptor
  self.component
end