Class: SgPostcode::ResponseBuilder::Builder
- Inherits:
-
Object
- Object
- SgPostcode::ResponseBuilder::Builder
- Defined in:
- lib/sg_postcode/response/response_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Instance Method Summary collapse
-
#data ⇒ Object
Implement this method in the subclass instead.
-
#initialize(raw_data) ⇒ Builder
constructor
Initialize a new builder.
Constructor Details
#initialize(raw_data) ⇒ Builder
Initialize a new builder
All subclass of Builder will inherit this method
raw_data must have the ‘results’, follow is an array
10 11 12 13 |
# 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 |
Instance Attribute Details
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
4 5 6 |
# File 'lib/sg_postcode/response/response_builder.rb', line 4 def raw_data @raw_data end |
Instance Method Details
#data ⇒ Object
Implement this method in the subclass instead
16 17 18 |
# File 'lib/sg_postcode/response/response_builder.rb', line 16 def data raise NotImplementedError end |