Skip to content

Instantly share code, notes, and snippets.

@sled
Last active April 12, 2016 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sled/954be0a9e749a4036cc8e6bee614339d to your computer and use it in GitHub Desktop.
Save sled/954be0a9e749a4036cc8e6bee614339d to your computer and use it in GitHub Desktop.
location.rb
module Hypo
module Types
module Addressable
extend ActiveSupport::Concern
included do
attribute :address_line1, Types::String
attribute :address_line2, Types::String
attribute :city, Types::String
attribute :zip, Types::String
attribute :state, Types::String
attribute :country, Types::String
end
end
end
end
module Hypo
module Types
class Location < Dry::Types::Struct
constructor_type(:schema)
include Hypo::Types::Addressable
PropertySituations = Types::Strict::String.enum('own', 'lease')
attribute :contact, Types::String
attribute :phone_number, Types::String
attribute :fax_number, Types::String
attribute :years_there, Types::Int
attribute :property_situation, PropertySituations
attribute :monthly_rent, Types::Int
attribute :lease_mortgage_term, Types::String
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment