diff --git a/README.md b/README.md index d3a15c2..78d6eb3 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,20 @@ class PostResource < ApplicationResource end ``` +`typelize` can be used with a Hash to specify multiple types at once. + +```ruby +class PostResource < ApplicationResource + attributes :id, :title, :body, :published_at + + attribute :author_name do |post| + post.author.name + end + + typelize author_name: :string, published_at: :string +end +``` + ### TypeScript Integration Typelizer generates TypeScript interfaces in the specified output directory: