Class: Zm::Client::Signature

Inherits:
Base::Object show all
Defined in:
lib/zm/client/signature/signature.rb

Overview

class account signature

Instance Attribute Summary collapse

Attributes inherited from Base::Object

#parent, #token

Instance Method Summary collapse

Methods inherited from Base::Object

#clone, #initialize, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute

Constructor Details

This class inherits a constructor from Zm::Client::Base::Object

Instance Attribute Details

#htmlObject

Returns the value of attribute html.



7
8
9
# File 'lib/zm/client/signature/signature.rb', line 7

def html
  @html
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/zm/client/signature/signature.rb', line 7

def id
  @id
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/zm/client/signature/signature.rb', line 7

def name
  @name
end

#txtObject

Returns the value of attribute txt.



7
8
9
# File 'lib/zm/client/signature/signature.rb', line 7

def txt
  @txt
end

Instance Method Details

#contentObject



51
52
53
# File 'lib/zm/client/signature/signature.rb', line 51

def content
  html || txt || ''
end

#create!Object



9
10
11
12
# File 'lib/zm/client/signature/signature.rb', line 9

def create!
  rep = @parent.sacc.invoke(jsns_builder.to_jsns)
  @id = rep[:CreateSignatureResponse][:signature].first[:id]
end

#delete!Object



30
31
32
33
34
35
# File 'lib/zm/client/signature/signature.rb', line 30

def delete!
  return false if @id.nil?

  @parent.sacc.invoke(jsns_builder.to_delete)
  @id = nil
end

#html?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/zm/client/signature/signature.rb', line 43

def html?
  type == ContentType::HTML
end

#modify!Object



14
15
16
17
# File 'lib/zm/client/signature/signature.rb', line 14

def modify!
  @parent.sacc.invoke(jsns_builder.to_update)
  true
end

#rename!(new_name) ⇒ Object



23
24
25
26
27
28
# File 'lib/zm/client/signature/signature.rb', line 23

def rename!(new_name)
  return if new_name == @name

  @parent.sacc.invoke(jsns_builder.to_rename(new_name))
  @name = new_name
end

#txt?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/zm/client/signature/signature.rb', line 47

def txt?
  type == ContentType::TEXT
end

#typeObject



37
38
39
40
41
# File 'lib/zm/client/signature/signature.rb', line 37

def type
  return ContentType::HTML unless html.nil?

  ContentType::TEXT
end

#update!(*args) ⇒ Object

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/zm/client/signature/signature.rb', line 19

def update!(*args)
  raise NotImplementedError
end