Class: At_email::Core::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/at_email/core/default.rb

Direct Known Subclasses

Tasks::TaskThread, Threads::Thread_Queue

Constant Summary collapse

CLASS_DISPLAY_NAME =
'atEmail - Default Class'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDefault

Returns a new instance of Default.



8
9
10
11
12
13
14
15
# File 'lib/at_email/core/default.rb', line 8

def initialize()
  @properties = {}
  @properties['State'] = 'New'
  @properties['ID'] = At_email::Formatting.new.get_random_id(5)
  @properties['Display Name'] = CLASS_DISPLAY_NAME
  @properties['Log Prefix'] = @properties['Display Name'] + ': ' + @properties['ID']
  @properties['State'] = 'Initialized'
end

Instance Attribute Details

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/at_email/core/default.rb', line 6

def properties
  @properties
end

Instance Method Details

#get(property) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/at_email/core/default.rb', line 17

def get(property)
  if !@properties[property]
    log_event event_tag='ERROR', 'Cannot get property: ' + property + "\n" + __LINE__ + "\n" + (pp caller())
    return false
  end
  return @properties[property]
end

#get_formatted(property) ⇒ Object



25
26
27
28
29
# File 'lib/at_email/core/default.rb', line 25

def get_formatted(property)
  value = get(property)
  output = property + ': ' + value.to_s
  return output
end

#get_stateObject



31
32
33
# File 'lib/at_email/core/default.rb', line 31

def get_state()
  return get('State')
end

#set_state(value) ⇒ Object



35
36
37
# File 'lib/at_email/core/default.rb', line 35

def set_state(value)
  set('State', value)
end