Class: PFA::RelativePFA::DataTime

Inherits:
Object
  • Object
show all
Includes:
PFAElementModule
Defined in:
lib/pfa/relative_pfa_datatime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PFAElementModule

#abs_data, #drawnable?, #part?, #printable?

Constructor Details

#initialize(pfa, key, value = nil) ⇒ DataTime

Returns a new instance of DataTime.

Parameters:

  • key (Symbol)

    La clé structurelle (:zero ou :end_time)

  • value (String|Integer|Hash) (defaults to: nil)

    Dans valeur de cette donnée temps. Ça peut être soit un temps, soit une table contenant le temps et la description.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pfa/relative_pfa_datatime.rb', line 19

def initialize(pfa, key, value = nil)
  @pfa        = pfa
  @key        = key
  @ini_value  = value
  case value
  when Hash
    @horloge = value[:t]||value[:time]||value[:horloge]
    @description = value[:d]||value[:description]
  else
    @horloge  = value
  end
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



8
9
10
# File 'lib/pfa/relative_pfa_datatime.rb', line 8

def key
  @key
end

#pfaObject (readonly)

Returns the value of attribute pfa.



8
9
10
# File 'lib/pfa/relative_pfa_datatime.rb', line 8

def pfa
  @pfa
end

Instance Method Details

#timeObject Also known as: start_at



32
33
34
# File 'lib/pfa/relative_pfa_datatime.rb', line 32

def time
  @time ||= PFA::NTime.new(@horloge, 0)
end

#typeObject

Pour la compatibilité quand on boucle sur tous les éléments des données du paradigme relatif



39
# File 'lib/pfa/relative_pfa_datatime.rb', line 39

def type; nil end