(no title)
cschneid | 1 year ago
class GetThingResult
def initialize(json)
@json = json
end
# single thing
def thing_id
@json.dig('wrapper', 'metadata', 'id')
end
# multiple things
def history
@json['history'].map { |h| ThingHistory.new(h) }
end
... two dozen more things
end
No comments yet.