Module: Rhoconnect::Resource::InstanceMethods

Defined in:
lib/rhoconnect/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#skip_rhoconnect_callbacksObject

Returns the value of attribute skip_rhoconnect_callbacks.



41
42
43
# File 'lib/rhoconnect/resource.rb', line 41

def skip_rhoconnect_callbacks
  @skip_rhoconnect_callbacks
end

Instance Method Details

#get_partitionObject



43
44
45
46
# File 'lib/rhoconnect/resource.rb', line 43

def get_partition
  @partition = partition
  @partition.is_a?(Proc) ? @partition.call : @partition
end

#normalized_attributesObject

Return Rhoconnect-friendly attributes list



71
72
73
74
75
76
77
# File 'lib/rhoconnect/resource.rb', line 71

def normalized_attributes
  attribs = self.attributes.dup
  attribs.each do |key,value|
    attribs[key] = Time.parse(value.to_s).to_i.to_s if value.is_a?(Time) or value.is_a?(DateTime)
  end if Rhoconnect.configuration.sync_time_as_int
  attribs
end

#rhoconnect_apply_attributes(partition, attributes) ⇒ Object

By default we ignore partition TODO: Document - this is user-facing function



66
67
68
# File 'lib/rhoconnect/resource.rb', line 66

def rhoconnect_apply_attributes(partition, attributes)
  self.attributes = attributes
end

#rhoconnect_createObject



48
49
50
# File 'lib/rhoconnect/resource.rb', line 48

def rhoconnect_create
  call_client_method(:create)
end

#rhoconnect_destroyObject



52
53
54
# File 'lib/rhoconnect/resource.rb', line 52

def rhoconnect_destroy
  call_client_method(:destroy)
end

#rhoconnect_query(partition) ⇒ Object



60
61
62
# File 'lib/rhoconnect/resource.rb', line 60

def rhoconnect_query(partition)
  #return all objects for this partition 
end

#rhoconnect_updateObject



56
57
58
# File 'lib/rhoconnect/resource.rb', line 56

def rhoconnect_update
  call_client_method(:update)
end