Class: PinboardLogseq::Pin

Inherits:
T::Struct
  • Object
show all
Includes:
T::Sig
Defined in:
lib/pinboard_logseq/pin.rb

Class Method Summary collapse

Class Method Details

.from_hash(json) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pinboard_logseq/pin.rb', line 19

def self.from_hash(json)
  new(
    href: json["href"],
    description: json["description"],
    extended: json["extended"],
    meta: json["meta"],
    pinboard_hash: json["hash"],
    time: Date.iso8601(json["time"]),
    shared: str_to_bool(json["shared"]),
    to_read: str_to_bool(json["toread"]),
    tags: json["tags"].split(" ")
  )
end