Class: Proz::WiwoEntry

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/proz/wiwo_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, message:, **options) ⇒ WiwoEntry



8
9
10
11
12
# File 'lib/proz/wiwo_entry.rb', line 8

def initialize(token:, message:, **options)
  @token = token
  @message = { message: message }
  @options = options
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/proz/wiwo_entry.rb', line 7

def message
  @message
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/proz/wiwo_entry.rb', line 7

def options
  @options
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/proz/wiwo_entry.rb', line 7

def token
  @token
end

Instance Method Details

#postObject



14
15
16
17
18
19
# File 'lib/proz/wiwo_entry.rb', line 14

def post
  body = message.merge!(options)
  self.class.post("/wiwo",
    body: body,
    headers: { 'Authorization' => "Bearer #{token}" } )
end