Skip to content

Instantly share code, notes, and snippets.

@sled sled/addressable.rb Secret
Last active Apr 12, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.