Class: OpenShift::ComponentRef
- Defined in:
- lib/openshift-origin-common/models/component_ref.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
Returns the value of attribute component.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #from_descriptor(spec_hash) ⇒ Object
- #get_name_prefix(profile) ⇒ Object
-
#initialize(name = nil) ⇒ ComponentRef
constructor
A new instance of ComponentRef.
- #to_descriptor ⇒ Object
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
#component ⇒ Object
Returns the value of attribute component.
3 4 5 |
# File 'lib/openshift-origin-common/models/component_ref.rb', line 3 def component @component end |
#name ⇒ Object
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_descriptor ⇒ Object
14 15 16 |
# File 'lib/openshift-origin-common/models/component_ref.rb', line 14 def to_descriptor self.component end |