-
-
Save sled/954be0a9e749a4036cc8e6bee614339d to your computer and use it in GitHub Desktop.
location.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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