Class: Unit::Reward::GetRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/reward/get_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reward_id, include = nil) ⇒ GetRequest

Returns a new instance of GetRequest.

Parameters:

  • reward_id (String)
  • include (Array<String>) (defaults to: nil)
    • optional



12
13
14
15
# File 'lib/unit/models/reward/get_request.rb', line 12

def initialize(reward_id, include = nil)
  @reward_id = reward_id
  @include = include
end

Instance Attribute Details

#includeObject (readonly)

Returns the value of attribute include.



8
9
10
# File 'lib/unit/models/reward/get_request.rb', line 8

def include
  @include
end

#reward_idObject (readonly)

Returns the value of attribute reward_id.



8
9
10
# File 'lib/unit/models/reward/get_request.rb', line 8

def reward_id
  @reward_id
end

Instance Method Details

#to_hashObject



17
18
19
# File 'lib/unit/models/reward/get_request.rb', line 17

def to_hash
  { include: include&.join(",") }.compact
end