lib/chatwork/operations.rb in chatwork-0.0.2 vs lib/chatwork/operations.rb in chatwork-0.0.3
- old
+ new
@@ -5,10 +5,17 @@
end
def define_create
instance_eval do
def create(params = {})
- convert(ChatWork.client.post(path, params))
+ # TODO: Consider other pattern
+ # /rooms and /rooms/:room_id
+ assign_path = if params.include?(:room_id)
+ path % params.delete(:room_id)
+ else
+ path
+ end
+ convert(ChatWork.client.post(assign_path, params))
end
end
end
end
end