Class: PartyResource::Buildable::Builder

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

Instance Method Summary collapse

Constructor Details

#initialize(build_options) ⇒ Builder

Returns a new instance of Builder.



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

def initialize(build_options)
  @build_options = build_options
end

Instance Method Details

#call(raw_result, context, included) ⇒ Object



13
14
15
16
17
# File 'lib/party_resource/buildable.rb', line 13

def call(raw_result, context, included)
  return nil if raw_result.nil?
  return raw_result.map{ |value| build_result(value, context, included) } if map_result?(raw_result)
  build_result(raw_result, context, included)
end