Class: Postio::Models::AddressUdprnEnvelope

Inherits:
Data
  • Object
show all
Defined in:
lib/postio/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta

Returns:

  • (Object)

    the current value of meta



168
169
170
# File 'lib/postio/models.rb', line 168

def meta
  @meta
end

#resultsObject (readonly)

Returns the value of attribute results

Returns:

  • (Object)

    the current value of results



168
169
170
# File 'lib/postio/models.rb', line 168

def results
  @results
end

#successObject (readonly)

Returns the value of attribute success

Returns:

  • (Object)

    the current value of success



168
169
170
# File 'lib/postio/models.rb', line 168

def success
  @success
end

Class Method Details

.from_hash(h) ⇒ Object



169
170
171
172
173
174
175
# File 'lib/postio/models.rb', line 169

def self.from_hash(h)
  new(
    success: h["success"] == true,
    results: (h["results"] || []).map { |r| Address.from_hash(r) },
    meta:    Meta.from_hash(h["meta"])
  )
end