Class: Protor::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/protor/entry.rb

Constant Summary collapse

VALID_NAME =
/^[a-zA-Z_:][a-zA-Z0-9_:]+$/
VALID_TYPE =
[:c, :g, :h]
VALID_LABEL_NAME =
/^[a-zA-Z_][a-zA-Z0-9_]*$/
VALID_LABEL_VALUE =
/^[^;|=]+$/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, value, labels = nil, additional = nil) ⇒ Entry



11
12
13
14
15
16
17
18
19
# File 'lib/protor/entry.rb', line 11

def initialize(name, type, value, labels = nil, additional = nil)
  @name       = name.to_s
  @type       = type
  @value      = value
  @labels     = labels || {}
  @additional = additional || []

  verify
end

Instance Attribute Details

#additionalObject (readonly)

Returns the value of attribute additional.



3
4
5
# File 'lib/protor/entry.rb', line 3

def additional
  @additional
end

#labelsObject (readonly)

Returns the value of attribute labels.



3
4
5
# File 'lib/protor/entry.rb', line 3

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/protor/entry.rb', line 3

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/protor/entry.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/protor/entry.rb', line 3

def value
  @value
end