mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-04-06 10:55:50 +00:00
- Convert all model classes to Dry::Struct - Add Types module with StringOrInteger and BooleanFlag
14 lines
333 B
Ruby
14 lines
333 B
Ruby
require 'dry-struct'
|
|
require 'instapaper/types'
|
|
|
|
module Instapaper
|
|
class User < Dry::Struct
|
|
include Types
|
|
transform_keys(&:to_sym)
|
|
|
|
attribute :username, Types::String
|
|
attribute :user_id, Types::Integer
|
|
attribute :type, Types::String
|
|
attribute? :subscription_is_active, Types::BooleanFlag.optional
|
|
end
|
|
end
|