class SgPostcode::ResponseBuilder::Builder

Attributes

raw_data[R]

Public Class Methods

new(raw_data) click to toggle source

Initialize a new builder

All subclass of Builder will inherit this method

raw_data must have the ‘results’, follow is an array

# File lib/sg_postcode/response/response_builder.rb, line 10
def initialize(raw_data)
  # FIXME: check if the data is invalid
  @raw_data = raw_data['results'].first rescue nil
end

Public Instance Methods

data() click to toggle source

Implement this method in the subclass instead

# File lib/sg_postcode/response/response_builder.rb, line 16
def data
  raise NotImplementedError
end