Class: HFAM::Payload

Inherits:
Hash
  • Object
show all
Defined in:
lib/hfam/payload.rb

Instance Method Summary collapse

Constructor Details

#initializePayload

Returns a new instance of Payload.



4
5
6
7
8
9
# File 'lib/hfam/payload.rb', line 4

def initialize
  super

  self[:metadata] = Hash.new
  self[:commands] = Array.new { |value| [:unknown, value] }
end

Instance Method Details

#commandsObject



27
28
29
# File 'lib/hfam/payload.rb', line 27

def commands
  self[:commands]
end

#help_messageObject



15
16
17
# File 'lib/hfam/payload.rb', line 15

def help_message
  [:help]
end

#help_option?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/hfam/payload.rb', line 11

def help_option?
  !![:help]
end

#metadataObject



19
20
21
# File 'lib/hfam/payload.rb', line 19

def 
  self[:metadata]
end

#metadata=(h) ⇒ Object



23
24
25
# File 'lib/hfam/payload.rb', line 23

def metadata=(h)
  self[:metadata] = h.dup
end