Class: Unified2::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/unified2/signature.rb

Overview

Signature

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signature = {}) ⇒ Signature

Initialize signature object

Parameters:

  • signature (Hash) (defaults to: {})

    Signature hash attributes

Options Hash (signature):

  • :signature_id (Integer)

    Signature id

  • :generator_id (Integer)

    Generator id

  • :revision (Integer)

    Signature revision

  • :name (Integer)

    Signature name

  • :blank (true, false)

    Signature exists



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

def initialize(signature={})
  @id = signature[:signature_id] || 0
  @generator = signature[:generator_id]
  @revision = signature[:revision]
  @name = signature[:name].strip
  @blank = signature[:blank] || false
end

Instance Attribute Details

#blankObject

Returns the value of attribute blank.



10
11
12
# File 'lib/unified2/signature.rb', line 10

def blank
  @blank
end

#generatorObject

Returns the value of attribute generator.



10
11
12
# File 'lib/unified2/signature.rb', line 10

def generator
  @generator
end

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/unified2/signature.rb', line 10

def id
  @id
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/unified2/signature.rb', line 10

def name
  @name
end

#revisionObject

Returns the value of attribute revision.



10
11
12
# File 'lib/unified2/signature.rb', line 10

def revision
  @revision
end

Instance Method Details

#blank?true, false

Blank?

Returns:

  • (true, false)

    Return true if signature exists



46
47
48
# File 'lib/unified2/signature.rb', line 46

def blank?
  @blank
end

#referencesArray<String,String>

References

Returns:



55
56
57
# File 'lib/unified2/signature.rb', line 55

def references
  @references
end

#to_sString

to_string

Returns:



36
37
38
# File 'lib/unified2/signature.rb', line 36

def to_s
  @name
end