Class: Hutzbot::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Response

Returns a new instance of Response.



14
15
16
# File 'lib/hutzbot/hutzbot.rb', line 14

def initialize attrs
  @id, @speaker, @speaker_name, @statement, @metadata = *attrs.values_at('id', 'speaker', 'speaker_name', 'statement', 'metadata')
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#metadataObject

Returns the value of attribute metadata.



12
13
14
# File 'lib/hutzbot/hutzbot.rb', line 12

def 
  @metadata
end

#speakerObject

Returns the value of attribute speaker.



9
10
11
# File 'lib/hutzbot/hutzbot.rb', line 9

def speaker
  @speaker
end

#speaker_nameObject

Returns the value of attribute speaker_name.



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

def speaker_name
  @speaker_name
end

#statementObject

Returns the value of attribute statement.



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

def statement
  @statement
end

Instance Method Details

#system?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/hutzbot/hutzbot.rb', line 18

def system?
  speaker=='system'
end