Module: DNApi::Component::ClassExt

Defined in:
lib/dnapi/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/dnapi/component.rb', line 6

def description
  @description
end

#key_idObject

Returns the value of attribute key_id.



6
7
8
# File 'lib/dnapi/component.rb', line 6

def key_id
  @key_id
end

#parentObject

Returns the value of attribute parent.



6
7
8
# File 'lib/dnapi/component.rb', line 6

def parent
  @parent
end

#stack_versionsObject

Returns the value of attribute stack_versions.



6
7
8
# File 'lib/dnapi/component.rb', line 6

def stack_versions
  @stack_versions
end

Instance Method Details

#belongs_to(klass) ⇒ Object



11
12
13
14
15
16
# File 'lib/dnapi/component.rb', line 11

def belongs_to(klass)
  name = klass.name.split(/::/).last.downcase
  self.send :alias_method, name, :parent
  self.send :alias_method, "#{name}=", :parent=
  @parent = klass
end