module Framework
 class CreateTableDefinition 
   attr_accessor :host, :username, :password
 end 
end
def create_table(table_name)
  obj = Framework::CreateTableDefinition.new
  yield(obj) if block_given?
end
create_table :users do |config|
  config.host :localhost
end
And here is the error I get
-:13:in `block in <main>': wrong number of arguments (1 for 0) (ArgumentError)
    from -:9:in `create_table'
    from -:12:in `<main>'
If I change the code to
config.host = :localhost
it works fine. But what I want is to work as described above config.host :localhost
CreateTableDefinitionclass to have ahostmethod that assigns its argument to the@hostlocal, does that sound right?