Class: Jpzip::Meta

Inherits:
Data
  • Object
show all
Defined in:
lib/jpzip/types.rb

Overview

Meta is /meta.json.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#by_prefObject (readonly)

Returns the value of attribute by_pref

Returns:

  • (Object)

    the current value of by_pref



61
62
63
# File 'lib/jpzip/types.rb', line 61

def by_pref
  @by_pref
end

#data_sourceObject (readonly)

Returns the value of attribute data_source

Returns:

  • (Object)

    the current value of data_source



61
62
63
# File 'lib/jpzip/types.rb', line 61

def data_source
  @data_source
end

#endpointsObject (readonly)

Returns the value of attribute endpoints

Returns:

  • (Object)

    the current value of endpoints



61
62
63
# File 'lib/jpzip/types.rb', line 61

def endpoints
  @endpoints
end

#generated_atObject (readonly)

Returns the value of attribute generated_at

Returns:

  • (Object)

    the current value of generated_at



61
62
63
# File 'lib/jpzip/types.rb', line 61

def generated_at
  @generated_at
end

#prefix_countObject (readonly)

Returns the value of attribute prefix_count

Returns:

  • (Object)

    the current value of prefix_count



61
62
63
# File 'lib/jpzip/types.rb', line 61

def prefix_count
  @prefix_count
end

#spec_versionObject (readonly)

Returns the value of attribute spec_version

Returns:

  • (Object)

    the current value of spec_version



61
62
63
# File 'lib/jpzip/types.rb', line 61

def spec_version
  @spec_version
end

#total_zipcodesObject (readonly)

Returns the value of attribute total_zipcodes

Returns:

  • (Object)

    the current value of total_zipcodes



61
62
63
# File 'lib/jpzip/types.rb', line 61

def total_zipcodes
  @total_zipcodes
end

#versionObject (readonly)

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



61
62
63
# File 'lib/jpzip/types.rb', line 61

def version
  @version
end

Class Method Details

.from_hash(h) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/jpzip/types.rb', line 71

def self.from_hash(h)
  new(
    version: h["version"] || "",
    generated_at: h["generated_at"] || "",
    spec_version: h["spec_version"] || "",
    total_zipcodes: h["total_zipcodes"] || 0,
    prefix_count: h["prefix_count"] || 0,
    by_pref: h["by_pref"] || {},
    data_source: h["data_source"] || "",
    endpoints: Endpoints.from_hash(h["endpoints"] || {})
  )
end