Class: JapaneseAddressParser::Data::ApiMeta

Inherits:
Data
  • Object
show all
Defined in:
lib/japanese_address_parser/data/api_meta.rb,
lib/japanese_address_parser/data/api_meta.rb,
sig/data.rbs

Overview

API レスポンスの meta。updated はデータの更新時刻で、町字/サブリソース取得時の ?v={apiVersion} に使う(キャッシュバスティング)。

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#updatedObject (readonly)

Returns the value of attribute updated

Returns:

  • (Object)

    the current value of updated



10
11
12
# File 'lib/japanese_address_parser/data/api_meta.rb', line 10

def updated
  @updated
end

Class Method Details

.from_json(hash) ⇒ ApiMeta

JSON(パース済み Hash・文字列キー)から VO を生成する Ruby 独自ヘルパ。

Parameters:

  • hash (Hash[String, untyped])

Returns:



15
16
17
# File 'lib/japanese_address_parser/data/api_meta.rb', line 15

def self.from_json(hash)
  new(updated: hash['updated'])
end

.newinstance

Parameters:

  • updated: (Integer)

Returns:

  • (instance)


86
# File 'sig/data.rbs', line 86

def self.new: (updated: Integer) -> instance