Skip to content

Instantly share code, notes, and snippets.

@littleidea
Created May 10, 2010 02:57
Show Gist options
  • Save littleidea/395626 to your computer and use it in GitHub Desktop.
Save littleidea/395626 to your computer and use it in GitHub Desktop.
instead of billing_step_1
class ContactInfo
attr_accessor :address_line_1, :address_line_2, :city, :region_id, :country_id, :phone
def initialize
def initialize(addy_line_1, addy_line_2, city, region_id, country_id, phone)
@address_line_1 = addy_line_1
@address_line_2 = addy_line_2
@city = city
@region_id = region_id
@country_id = country_id
@phone = phone
end
end
class Customer
attr_accessor :first_name, :last_name, :address
def initialize(first_name, last_name, contact_info)
@first_name = first_name
@last_name = last_name
@contact_info = contact_info
end
end
def enter(field, value)
b.text_field(:id, field).set value
end
def enter_customer_contact_info(customer)
enter("countryID", customer.contact_info.country_id)
enter("firstName", customer.first_name)
enter etc etc...
end
contact_info = ContactInfo.new("123 wtf", "", "O-town", "NSFW", "SU", "666.666.6666")
customer = Customer.new("Bob", "Somethingsonberg", contact_info)
enter_customer_contact_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment