Class: OMF::SFA::Resource::OLease

Inherits:
OResource
  • Object
show all
Extended by:
Base::ClassMethods
Includes:
Base::InstanceMethods
Defined in:
lib/omf-sfa/resource/olease.rb

Instance Method Summary collapse

Methods included from Base::ClassMethods

_sfa_add_ns, _sfa_prefix_for_namespace, _to_sfa_xml, default_component_manager_id, default_domain, descendants, from_sfa, sfa, sfa_add_namespace, sfa_add_namespaces_to_document, sfa_cast_property_value, sfa_class, sfa_def_for, sfa_defs, sfa_suppress_id, sfa_suppress_id?, sfa_suppress_uuid, sfa_suppress_uuid?, to_rspec

Methods included from Base::InstanceMethods

#_to_sfa_property_hash, #_to_sfa_property_xml, #_to_sfa_xml, #_xml_name, #component_id, #component_manager_id, #default_domain, #from_sfa, #resource_type, #sfa_class, #sfa_id, #sfa_property, #to_sfa_hash, #to_sfa_hash_short, #to_sfa_short_xml, #to_sfa_xml

Methods inherited from OResource

#_dirty_self?, #_oprops_to_hash, #all_resources, #clone, #default_href_prefix, #destroy, #destroy!, #dirty_self?, #each_resource, #group?, #href, href_resolver, init, json_create, #oproperties_as_hash, #oproperty, oproperty, #oproperty_array_get, #oproperty_get, #oproperty_set, prop_all, #remove_from_all_groups, #resource_type, #status, #to_hash, #to_hash_brief, #to_hash_long, #to_json, #uuid

Instance Method Details

#to_sfa_ref_xml(res_el, obj2id, opts) ⇒ Object

def status # puts “status call”

s = oproperty_get(:status)
if s.nil?

# puts “setting”

  oproperty_set(:status, "pending")
else

# puts “hmm”

    s
  end
end


50
51
52
53
54
55
56
57
58
# File 'lib/omf-sfa/resource/olease.rb', line 50

def to_sfa_ref_xml(res_el, obj2id, opts)
  if obj2id.key?(self)
    el = res_el.add_child(Nokogiri::XML::Element.new("ol:lease_ref", res_el.document))
    #el.set_attribute('component_id', self.component_id.to_s)
    el.set_attribute('id_ref', self.uuid.to_s)
  else
    self.to_sfa_xml(res_el, obj2id, opts)
  end
end