Class: Proz::GetWiwoEntry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, user_uuid:, include_private:) ⇒ GetWiwoEntry

Returns a new instance of GetWiwoEntry.



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

def initialize(token:, user_uuid:, include_private:)
  @token = token
  @include_private = include_private
  @user_uuid = user_uuid
end

Instance Attribute Details

#include_privateObject (readonly)

Returns the value of attribute include_private.



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

def include_private
  @include_private
end

#tokenObject (readonly)

Returns the value of attribute token.



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

def token
  @token
end

#user_uuidObject (readonly)

Returns the value of attribute user_uuid.



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

def user_uuid
  @user_uuid
end

Instance Method Details

#getObject



14
15
16
17
18
19
20
21
22
# File 'lib/proz/get_wiwo_entry.rb', line 14

def get
  if include_private
    self.class.get("/wiwo?user_uuid=" + user_uuid + "&include_private=1",
    headers: { 'Authorization' => "Bearer #{token}" } )
  else
    self.class.get("/wiwo?user_uuid=" + user_uuid,
    headers: { 'Authorization' => "Bearer #{token}" } )
  end
end